Method and apparatus for encoding video, and decoding method and apparatus

ABSTRACT

A method for decoding an image, the method including decoding base block size information on a size of a base block from a bitstream, decoding residual presence information of a decoding object unit from the bitstream, the residual presence information indicating whether the decoding object unit has residual signal or not, when the residual presence information indicates that the decoding object unit has the residual signal, decoding a residual quantization parameter of the decoding object unit from the bitstream, determining a quantization parameter of the decoding object unit based on the residual quantization parameter of the decoding object unit, and performing inverse quantization for the decoding object unit based on the quantization parameter.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is a continuation application of U.S.application Ser. No. 15/801,423, filed on Nov. 2, 2017, which is acontinuation application of U.S. application Ser. No. 15/489,290, filedon Apr. 17, 2017, which is a continuation application of U.S.application Ser. No. 13/808,433, filed on Jan. 4, 2013 with the UnitedStates Patent and Trademark Office, which is a U.S. national stagepatent application of PCT/KR2011/006052 filed on Aug. 17, 2011, whichclaims priority to Korean patent applications: KR10-2010-0079104 filedon Aug. 17, 2010; KR10-2010-0124181 filed on Dec. 7, 2010;KR10-2011-0025572 filed on Mar. 22, 2011; and KR10-2011-0050852 filed onMay 27, 2011 with the Korean Intellectual Property Office, which isincorporated herein by reference in its entirety.

TECHNICAL FIELD

The present invention relates to an image encoding and decodingtechnology for encoding and decoding an image by setting a quantizationparameter of an encoding object block.

BACKGROUND ART

The demand for a high resolution and high quality image such as a highdefinition (HD) image and an ultra high definition (UHD) image hasrecently increased in various applications. As resolution and quality ofimage data have increased, a data amount relatively increases ascompared to existing image data. Therefore, when the image data istransmitted using a medium such as an existing wired and wirelessbroadband circuit or is stored using an existing storage medium, atransmission cost and a storage cost increase. In order to solve theseproblems generated due to the increase in the resolution and quality ofthe image data, high efficiency image compression technologies may beutilized. As an image compression technology, there are varioustechnologies such as an inter prediction technology in which pixelsvalues included in a current picture are predicted from pictures beforeor after the current picture, an intra prediction technology in whichpixel values included in a current picture is predicted using pixelinformation in the current picture, and an entropy encoding technologyin which a short code is allocated to a value having high appearancefrequency and a long code is allocated to a value having low appearancefrequency. The image data may be transmitted and stored in a state inwhich it is effectively compressed using these image compressiontechnologies.

DISCLOSURE Technical Problem

The present invention provides a method and an apparatus for encoding animage and a method and an apparatus for decoding an image in which aquantization parameter is adaptively set according to block informationof an encoding object block or block information of a decoding objectblock to effectively perform quantization, deblocking filtering, entropyencoding/decoding, inter prediction, rate control, rate-distortionoptimization, and the like.

Technical Solution

In an aspect, there is provided a method for decoding an image, themethod including: receiving block information of a decoding objectblock; and calculating a quantization parameter based on the blockinformation of the decoding object block.

The block information may be at least one of information on a size andinformation on a depth of the decoding object block.

The calculating of the quantization parameter based on the blockinformation of the decoding object block may include receiving at leastone of information on a size and information on a depth of the decodingobject block from the block information and setting a quantizationparameter of a predetermined decoding object block having a size smallerthan a predetermined size so as to be the same as a quantizationparameter set at the predetermined size.

The calculating of the quantization parameter based on the blockinformation of the decoding object block may include calculating thequantization parameter of the decoding object block using an equation ora value derived based on the block information of the decoding objectblock.

The calculating of the quantization parameter based on the blockinformation of the decoding object block may include calculating thequantization parameter of the decoding object block using quantizationparameter changeable information of the decoding object block.

The calculating of the quantization parameter based on the blockinformation of the decoding object block may include decoding thequantization parameter of the decoding object block based on whether ornot a residual signal to be decoded that is included in the decodingobject block is present.

The decoding object block may be a coding unit.

In another aspect, there is provided a method for decoding an image, themethod including: decoding a residual quantization parameter of adecoding object block; and predicting a quantization parameter of thedecoding object block based on block information of the decoding objectblock.

The decoding of the residual quantization parameter of the decodingobject block may be omitted when the decoding object block has a sizesmaller than a specific size of a block.

The predicting of the quantization parameter of the decoding objectblock may include predicting a quantization parameter of a predetermineddecoding object block using a quantization parameter of a decodingobject block having a size larger than that of the predetermineddecoding object block.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block using at least one of a quantization parameter of a blockthat is decoded before the decoding object block and a quantizationparameter of a block that is present at the left based on the decodingobject block and previously decoded.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block using a quantization parameter of a decoding object blockdefined in a sequence parameter set (SPS), a picture parameter set(PPS), or a slice header.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block based on similarity in a decoding parameter between thedecoding object block and a block that is previously decoded before thedecoding object block.

The decoding object block may be a coding unit.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block using a quantization parameter of an upper block based onthe decoding object block when the decoding object block isintra-decoded using restored pixels of the upper block and predictingthe quantization parameter of the decoding object block using aquantization parameter of a left block based on the decoding objectblock when the decoding object block is intra-decoded using restoredpixels of the left block.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block using a quantization parameter of an adjacent block of thedecoding object block that is decoded in the same prediction mode asthat of the decoding object block.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block based on a quantization parameter of a block within areference picture indicated by motion information of the decoding objectblock using the motion information when the decoding object block isinter-decoded.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block using a quantization parameter of a block having the samespatial position as that of the decoding object block in a slice or apicture that is previously decoded.

The predicting of the quantization parameter of the decoding objectblock may include predicting the quantization parameter of the decodingobject block using a set of quantization parameters of an adjacent blockof the decoding object block.

The predicting of the quantization parameter of the decoding objectblock using the set of quantization parameters of an adjacent block ofthe decoding object block may include predicting the quantizationparameter of the decoding object block based on the identificationinformation determining a quantization parameter used for predictionamong the quantization parameters included in the set of quantizationparameters of the adjacent block or predicting that a quantizationparameter having a median value among the quantization parametersincluded in the set of quantization parameters of the adjacent block isthe quantization parameter of the decoding object block.

Advantageous Effects

As set forth above, according to the embodiments of the presentinvention, the quantization parameter are adaptively set according tothe block information of the encoding object block or the blockinformation of the decoding object block to effectively performquantization/inverse quantization, deblocking filtering, entropyencoding/decoding, inter prediction, rate control, rate-distortionoptimization, and the like, thereby making it possible to improveencoding and decoding performance

DESCRIPTION OF DRAWINGS

FIG. 1 is a flow chart provided in order to describe a method forencoding an image according to an embodiment of the present invention.

FIG. 2 is a flow chart provided in order to describe a method forencoding an image based on a residual quantization parameter accordingto an embodiment of the present invention.

FIG. 3 is a block diagram showing a configuration of an apparatus forencoding an image according to an embodiment of the present invention.

FIG. 4 is a block diagram showing a configuration of an apparatus forencoding an image determining a residual quantization parameteraccording to an embodiment of the present invention.

FIG. 5 is a flow chart provided in order to describe a method fordecoding an image according to an embodiment of the present invention.

FIG. 6 is a flow chart provided in order to describe a method fordecoding an image based on a residual quantization parameter accordingto an embodiment of the present invention.

FIG. 7 is a block diagram showing a configuration of an apparatus fordecoding an image according to an embodiment of the present invention.

FIG. 8 is a block diagram showing a configuration of an apparatus fordecoding an image based on a residual quantization parameter accordingto an embodiment of the present invention.

FIG. 9 shows a method for predicting a quantization parameter accordingto an embodiment of the present invention.

MODE FOR INVENTION

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings. However, the presentinvention will be not limited or restricted to embodiments below. Likereference numerals proposed in each drawing denote like components.

Block information to be described below may include at least one of atype of a block such as a coding unit (CU), a prediction unit (PU), atransform unit (TU), or the like, a size of the block, a depth of theblock, and an encoding/decoding order of the block. Here, the blockmeans encoding and decoding object blocks having various sizes andforms, and may have a geometric shape that may be representedtwo-dimensionally, such as a rectangle, a square, a trapezoid, atriangle, a pentagon, or the like.

Here, the above-mentioned block means a unit of image encoding anddecoding. At the time of the image encoding and decoding, the unit ofthe image encoding and decoding indicates a divided unit when a singleimage is divided into subdivided blocks and then encoded or decoded.Therefore, it may be called a block, a macroblock, a coding unit, aprediction unit, a transform unit, or the like. A single block may befurther divided into sub-blocks having a smaller size. Terms used in thepresent description are used in order to appropriately representpreferred embodiments of the present invention and may be construed indifferent ways according to the intention of users or operators,customary practice in the art to which the present invention pertains.Therefore, the definitions of terms used in the present descriptionshould be construed based on the contents throughout the specification.

Here, a prediction block means a basic coding/decoding unit of aprediction process such as inter prediction, intra prediction, or thelike, and a transform block means a basic coding/decoding unit of aprocess of performing transform, inverse transform, quantization,inverse quantization, entropy encoding of a residual signal, and entropydecoding of the residual signal. Here, the entropy encoding means thatsymbol values are encoded using a method such as an arithmetic encodingmethod or a variable length encoding method to thereby generate abitstream, and the entropy decoding means that the symbol values aredecoded from the bitstream using a method such as an arithmetic decodingmethod or a variable length decoding method.

FIG. 1 is a flow chart provided in order to describe a method forencoding an image according to an embodiment of the present invention.

First, in operation (110), an apparatus for encoding an image may encodeblock information of an encoding object block.

As an example, the apparatus for encoding an image may entropy-encodethe block information of the encoding object block to thereby generate abitstream.

As another example, the apparatus for encoding an image mayentropy-encode the block information of the encoding object block in anyone of a sequence parameter set (SPS), a picture parameter set (PPS),and a slice header in a configuration of the bitstream.

More specifically, the apparatus for encoding an image mayentropy-encode the block information such as max_coding_unit_widthindicating a maximum width in a size of a coding unit,max_coding_unit_height indicating a maximum height in the size of thecoding unit, max_coding_unit_hierarchy_depth indicating a maximumhierarchy depth of the coding unit, log2_min_coding_unit_size_minus3indicating a minimum size of the coding unit,log2_min_transform_unit_size_minus2 indicating a minimum size of atransform unit, max_transform_unit_hierarchy_depth indicating a maximumhierarchy depth of the transform unit,log2_diff_max_min_coding_block_size indicating a difference betweenminimum and maximum sizes of the coding unit,log2_diff_max_min_transform_block_size indicating a difference betweenminimum and maximum sizes of the transform unit,max_transform_hierarchy_depth_inter indicating a maximum depth of aninter encoded transform unit, max_transform_hierarchy_depth_intraindicating a maximum depth of an intra encoded transform unit, and thelike, in any one of the sequence parameter set (SPS), the pictureparameter set (PPS), and the slice header in the configuration of thebitstream.

Then, in operation (120), the apparatus for encoding an image maydetermine a quantization parameter of the encoding object block based onthe block information of the encoding object block. Here, thequantization parameter (QP) means a parameter value determining a stepsize of quantization and inverse quantization.

As an example, the apparatus for encoding an image may determine thequantization parameter of the encoding object block using the followingmethods.

1) The apparatus for encoding an image may perform determination so thatthe same quantization parameter is used in each of a sequence unit, apicture unit, and a slice unit.

2) In addition, the apparatus for encoding an image may determine asingle quantization parameter per a largest coding tree block (LCTB) ora largest coding unit (LCU).

3) In addition, the apparatus for encoding an image may determine asingle quantization parameter per a smallest coding tree block (SCTB) ora smallest coding unit (SCU).

4) In addition, the apparatus for encoding an image may determine asingle quantization parameter per a prediction unit regardless of a sizeor a depth of the prediction unit.

5) In addition, the apparatus for encoding an image may determine asingle quantization parameter per a transform unit regardless of a sizeor a depth of the transform unit.

6) In addition, the apparatus for encoding an image may determine asingle quantization parameter in a specific depth or a specific size ofthe prediction unit.

7) In addition, the apparatus for encoding an image may determine asingle quantization parameter at a specific depth or a specific size ofthe transform unit. Here, a configuration in which the quantizationparameter is determined based on a specific depth or a specific size ofthe coding unit, a specific depth or a specific size of the predictionunit, and a specific depth or a specific size of the transform unit willbe described with reference to the following Table 1, Table 2, Table 3,Table 4, Table 6, Table 7, Table 8, Table 9, Table 10, Table 11, Table12, Table 13, and Table 14.

8) In addition, the apparatus for encoding an image may determine aquantization parameter of an encoding object block based on blockinformation defined in a sequence parameter set (SPS), a pictureparameter set (PPS), or a slice header.

9) In addition, the apparatus for encoding an image may determine aquantization parameter based on whether or not a residual signal ispresent in an encoding object block. As an example, in the absence ofthe residual signal in the encoding object block, the apparatus forencoding an image may not determine the quantization parameter. Here,the apparatus for encoding an image may determine whether or not theresidual signal is present using a coded block pattern, a coded blockflag, or the like. 10) In addition, the apparatus for encoding an imagemay determine a quantization parameter of an encoding object block basedon an equation or a value derived using block information of theencoding object block.

11) In addition, the apparatus for encoding an image may determine asingle quantization parameter using any one of a size of a transformunit (log2_min_transform_unit_size_minus2), a depth of the transformunit (max_transform_unit_hierarchy_depth), log2_diffmax_min_coding_block_size indicating a difference between minimum andmaximum sizes of a coding unit, log2_min_transform_block_size_minus2indicating a minimum size of the transform unit (a transform block),log2_diff_max_min_transform_block_size indicating a difference betweenminimum and maximum sizes of the transform unit,max_transform_hierarchy_depth_inter indicating a maximum depth of aninter encoded transform unit, and max_transform_hierarchy_depth_intraindicating a maximum depth of an intra encoded transform unit that aredefined in the SPS, PPS, or the slice header.

12) In addition, the apparatus for encoding an image may determine asingle quantization parameter using any one of a size of a coding unit(log2_min_coding_unit_size_minus3), a depth of the coding unit(max_coding_unit_hierarchy_depth), log2_diff_max_min_coding_block_sizeindicating a difference between minimum and maximum sizes of the codingunit, log2_min_transform_block_size_minus2 indicating a minimum size ofthe transform unit (a transform block),log2_diff_max_min_transform_block_size indicating a difference betweenminimum and maximum sizes of the transform unit,max_transform_hierarchy_depth_inter indicating a maximum depth of aninter encoded transform unit, and max_transform_hierarchy_depth_intraindicating a maximum depth of an intra encoded transform unit that aredefined in the SPS, PPS, or the slice header.

13) In addition, the apparatus for encoding an image may determine aquantization parameter of an encoding object block within a sequence,within a picture, within a slice, within a LCTB, or the like. Here, theapparatus for encoding an image may determine and change thequantization parameter only in a corresponding unit using quantizationparameter changeable information representing a change unit. Forexample, the apparatus for encoding an image may addqp_change_allowed_flag, which is a syntax element associated with thequantization parameter changeable information, to the PPS. Here, when alogical value of a corresponding syntax element is 1, the apparatus forencoding an image may change the quantization parameter in a unit (aslice, a coding unit (CU), a prediction unit (PU), a transform unit(TU), and the like) lower than a picture and determine the quantizationparameter of the encoding object block according to the changed value.In addition, when the logical value of the corresponding syntax elementis 0, the apparatus for encoding an image may not change thequantization parameter in the unit lower than the picture.

14) In addition, when the apparatus for encoding an image determines thequantization parameter of the encoding object block using theabove-mentioned methods 1) to 12), it may encode a syntax elementrepresenting information of the quantization parameter together with asize or a depth of a block in the PPS, the SPS, or the slice header.Further, the apparatus for encoding an image may set the quantizationparameter only up to at a specific depth or specific size of the blockaccording to depths or sizes of each of the coding unit, the predictionunit, and the transform unit based on the block information of theencoding object block. Here, in the presence of a block having a depthdeeper than a specific depth of the block in which the quantizationparameter is set, the apparatus for encoding an image may set aquantization parameter of the block having the deeper depth so as to bethe same as the quantization parameter set at the specific depth. Inaddition, qp_hierarchy_depth or log2_qp_unit_size may be individuallyapplied to each of the coding unit, the prediction unit, and thetransform unit. Here, qp_hierarchy_depth indicates a syntax elementrepresenting a specific depth of the block in which the quantizationparameter is set, and log2_qp_unit_size indicates a syntax elementrepresenting a specific size of the block in which the quantizationparameter is set. A more detailed configuration will be described belowwith reference to Table 1, Table 2, Table 3, Table 4, Table 6, Table 7,Table 8, Table 9, Table 10, Table 11, Table 12, Table 13, and Table 14.

The quantization parameter of the encoding object block may bedetermined by at least one of the methods for determining thequantization parameter of the encoding object block or a combinationthereof.

When the quantization parameter of the encoding object block isdetermined, in the presence of a block having a depth deeper than aspecific depth of the block in which the quantization parameter isdetermined, the apparatus for encoding an image may determine thequantization parameter of the block having the deeper depth so as to bethe same as the quantization parameter determined at the specific depth.In addition, in the presence of a block having a size smaller than aspecific size of the block in which the quantization parameter isdetermined, the apparatus for encoding an image may determine aquantization parameter of the block having the smaller size so as to bethe same as the quantization parameter determined at the specific size.

Next, in operation (130), the apparatus for encoding an image may encodethe determined quantization parameter.

As an example, the apparatus for encoding an image may entropy-encodethe quantization parameter of the encoding object block to therebygenerate a bitstream.

As another example, the apparatus for encoding an image may encode thequantization parameter of the encoding object block using any one of themethods 1) to 14) for determining a quantization parameter of anencoding object block as described in operation (120). For example, inthe case of using the method 1) or 2), the apparatus for encoding animage may encode a single quantization parameter per the LCTB or theSCTB. A process of encoding the quantization parameter of the encodingobject block using any one of the methods 3) to 14) is similar to theprocess of determining the quantization parameter in operation (120).Therefore, an overlapped description thereof will be omitted.

When the quantization parameter of the encoding object block is encoded,in the presence of a block having a depth deeper than a specific depthof the block in which the quantization parameter is encoded, theapparatus for encoding an image may omit the encoding of thequantization parameter of the block having the deeper depth. Inaddition, in the presence of a block having a size smaller than aspecific size of the block in which the quantization parameter isencoded, the apparatus for encoding an image may omit the encoding ofthe quantization parameter of the block having the smaller size.

Meanwhile, when the apparatus for encoding an image and an apparatus fordecoding an image previously know the block information of the encodingobject block or a bitstream is previously present, operation (110) maybe omitted in FIG. 1. That is, since the apparatus for encoding an imagepreviously knows the block information of the encoding object block, anoperation of entropy-encoding the block information of the encodingobject block to thereby generate a bitstream may be omitted.

Likewise, when the apparatus for encoding an image and the apparatus fordecoding an image previously knows the quantization parameter of theencoding object block, operation (130) may be omitted in FIG. 1. Thatis, since the apparatus for encoding an image previously knows thequantization parameter of the encoding object block, an operation ofentropy-encoding the quantization parameter of the encoding object blockto thereby generate a bitstream may be omitted.

FIG. 2 is a flow chart provided in order to describe a method forencoding an image based on a residual quantization parameter accordingto an embodiment of the present invention.

First, in operation (210), an apparatus for encoding an image may encodeblock information of an encoding object block. Here, when the apparatusfor encoding an image and the apparatus for decoding an image previouslyknows the block information of the encoding object block or a bitstreamis previously present, operation (210) may be omitted in FIG. 2.

Then, in operation (220), the apparatus for encoding an image maydetermine a quantization parameter of the encoding object block based onthe block information of the encoding object block.

Here, a process of encoding the block information and a process ofdetermining the quantization parameter are the same as the processesdescribed in operations (110 and 120) of FIG. 1. Therefore, anoverlapped description thereof will be omitted.

Next, in operation (230), the apparatus for encoding an image maypredict a quantization parameter of an encoding object block.

As an example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a quantizationparameter that is previously encoded before the encoding object block inan encoding order.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a quantizationparameter of a block that is previously encoded before the encodingobject block in the encoding order.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a set ofquantization parameters that are previously encoded before the encodingobject block in the encoding order.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a set ofquantization parameters of a block that is previously encoded before theencoding object block in the encoding order.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a quantizationparameter that is previously encoded adjacent to the encoding objectblock.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a set ofquantization parameters that are previously encoded adjacent to theencoding object block.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using quantizationparameters of the adjacent blocks that are previously encoded. Here, theadjacent blocks mean blocks positioned spatially adjacent to theencoding object block.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a set ofquantization parameters of adjacent blocks.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using quantizationparameters of blocks that have a depth shallower than that of theencoding object block among blocks that are previously encoded.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using quantizationparameters of blocks that have a size larger than that of the encodingobject block among blocks that are previously encoded.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using a quantizationparameter defined in the SPS, the PPS, or the slice header.

As another example, the apparatus for encoding an image may determine ablock having the same spatial position as that of the encoding objectblock in a previously encoded slice or a previously encoded picture andpredict the quantization parameter of the encoding object block using aquantization parameter of the determined block.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using at least oneof quantization parameters of blocks that are encoded before theencoding object block in a Z scan order and quantization parameters ofblocks that are present at the left based on the encoding object blockand are previously encoded, as shown in FIG. 9.

Here, when a largest coding unit (LCU) quantization parameter ispredicted, the quantization parameter of the encoding object block maybe predicted from quantization parameters of blocks present in an LCUthat is encoded before the encoding object block in an encoding order ora raster scan order or quantization parameters of blocks present in anLCU present at the left or the upper of the encoding object block.

Here, when a LCU quantization parameter is predicted, the quantizationparameter of the encoding object block may be predicted usingquantization parameters of blocks that are encoded before the encodingobject block in a Z scan order or quantization parameters of adjacentblocks based on the encoding object block.

Here, when the LCU is present at the leftmost portion within a slice ora picture, the quantization parameter of the encoding object block maybe predicted using one of a quantization parameter of the slice, aquantization parameter of the picture, quantization parameters of blockspresent in an LCU that is encoded before the encoding object block inthe encoding order or the raster scan order, and previously encodedquantization parameters of blocks previously present in the Z scanorder.

Numerals in blocks of FIG. 9 indicate an order in which the quantizationparameters are predicted. Within the LCU, the quantization parameter ofthe encoding object block may be predicted using the quantizationparameters of the blocks that are encoded before the encoding objectblock in the Z scan order, and between the LCUs, the quantizationparameter of the encoding object block may be predicted from thequantization parameters of the blocks present in the LCU that is encodedbefore the encoding object block in the encoding order or the rasterscan order.

As another example, the apparatus for encoding an image may predict thequantization parameter of the encoding object block using quantizationparameters of blocks that are previously encoded according to similarityof encoding parameters. Here, the encoding parameter may be a size of ablock, a depth of transform, motion merge, a motion vector predictor, anintra prediction direction, a prediction mode, a motion vector, areference picture index, a reference picture list, a coded blockpattern, a coded block flag, or the like. When the encoding object blockhas a size of N×M, the quantization parameter may be predicted usingblocks having a size of N×M among blocks adjacent to the encoding objectblock. When the encoding object block has a transform depth of N, thequantization parameter may be predicted using blocks having a transformdepth of N among the blocks adjacent to the encoding object block. Whenmotion merge is performed on the encoding object block, the quantizationparameter may be predicted using blocks that become motion mergeobjects. When the encoding object block uses the motion vectorpredictor, the quantization parameter may be predicted using a blockindicated by the corresponding motion vector predictor. When theencoding object block is intra encoded, the quantization parameter ofthe encoding object block may be predicted using quantization parametersof blocks encoded in the same intra prediction direction as or similarintra prediction direction to a corresponding intra predictiondirection. When the encoding object block is intra encoded usingrestored pixels of upper blocks based on the encoding object block, thequantization parameter of the encoding object block may be predictedusing quantization parameters of the upper blocks, and when the encodingobject block is intra encoded using restored pixels of left blocks basedon the encoding object block, the quantization parameter of the encodingobject block may be predicted using quantization parameters of the leftblocks. When the encoding object block is intra encoded, thequantization parameter of the encoding object block may be predictedusing blocks used to encode an intra prediction mode (direction) of theencoding object block among the blocks adjacent to the encoding objectblock. For example, when an intra prediction mode of any one of the leftblocks and the upper blocks based on the encoding object block is usedin encoding the intra prediction mode of the encoding object block, thequantization parameter of the encoding object block may be predictedusing quantization parameters of the used prediction unit. Thequantization parameter of the encoding object block may be predictedusing quantization parameters of blocks encoded in the same predictionmode as that of the encoding object block. For example, when theencoding object block is inter encoded, the quantization parameter ofthe encoding object block may be predicted using quantization parametersof blocks encoded in an inter prediction mode among blocks adjacent tothe encoding object block, and when the encoding object block is intraencoded, the quantization parameter of the encoding object block may bepredicted using quantization parameters of blocks encoded in the intraprediction mode among the blocks adjacent to the encoding object block.Here, in the presence of a plurality of blocks encoded in the sameprediction mode as that of the encoding object block, quantizationparameters of the plurality of blocks may be used to predict thequantization parameter of the encoding object block. When the encodingobject block is inter encoded, the quantization parameter of theencoding object block may be predicted using quantization parameters ofblocks within a reference picture indicated by motion information of theencoding object block using a motion vector, a reference picture index,and a reference picture list, which correspond to the motioninformation. Here, when the encoding object block has at least twomotion information, the number of quantization parameters of blockswithin the reference picture may be at least two. When a residual signalis not present in a block that is previously encoded and a coded blockpattern or a coded block flag is thus 0, a quantization parameter of acorresponding block may not be used to predict the quantizationparameter of the encoding object block. Here, the fact that the codedblock pattern or the coded block flag is 0 means that residual signalsof a luminance component and a chrominance component are not encoded ora residual signal of a luminance component is not encoded.

The quantization parameter of the encoding object block may be predictedusing at least one of the methods for predicting the quantizationparameter of the encoding object block or a combination thereof.

Next, in operation (240), the apparatus for encoding an image maydetermine a residual quantization parameter of the encoding objectblock.

Here, when the number of predicted quantization parameters of theencoding object block is plural, the apparatus for encoding an image maydetermine the residual quantization parameter of the encoding objectblock by calculating the average of the predicted quantizationparameters of the encoding object block and subtracting the calculatedaverage from the quantization parameter of the encoding object block.

In addition, the apparatus for encoding an image may determine theresidual quantization parameter of the encoding object block through adifference between the quantization parameter of the encoding objectblock and the predicted quantization parameters of the encoding objectblock.

As an example, when a quantization parameter of a block that ispreviously encoded in an encoding order is used as the predictedquantization parameter, the apparatus for encoding an image maydetermine the residual quantization parameter (unit_qp_delta) of theencoding object block by subtracting the quantization parameter(qp_prev_unit) of the block that is previously encoded in the encodingorder from the quantization parameter (qp_curr_unit) of the encodingobject block.

As another example, when a set of quantization parameters of a blockthat is previously encoded in the encoding order is used as thepredicted quantization parameter, the apparatus for encoding an imagemay determine the residual quantization parameter (unit_qp_delta) of theencoding object block by subtracting any one of quantization parametersconfiguring the set (qp_prev_unit_1, qp_prev_unit_2, qp_prev_unit_3) ofquantization parameters of the block that is previously encoded in theencoding order from the quantization parameter (qp_curr_unit) of theencoding object block. Here, qp_prev_unit_1 may be a quantizationparameter of a block that is encoded before the encoding object block byone block in the encoding order, qp_prev_unit_2 may be a quantizationparameter of a block that is encoded before the encoding object block bytwo blocks in the encoding order, and qp_prev_unit_3 may be aquantization parameter of a block that is encoded before the encodingobject block by three blocks in the encoding order. Here, the apparatusfor encoding an image may transmit quantization parameter identificationinformation indicating what quantization parameter (that is, a predictedquantization parameter) among the quantization parameters configuringthe set of quantization parameters was used to determine the residualquantization parameter to the apparatus for decoding an image.

As another example, when a quantization parameter of a block that ispreviously encoded at an upper of the encoding object block is used asthe predicted quantization parameter, the apparatus for encoding animage may determine the residual quantization parameter (unit_qp_delta)of the encoding object block by subtracting the quantization parameter(qp_prev_unit) of the block that is previously encoded at an upper ofthe encoding object block from the quantization parameter (qp_curr_unit)of the encoding object block.

As another example, when a set of quantization parameters of adjacentblocks that are previously encoded is used, the apparatus for encodingan image may determine the residual quantization parameter(unit_qp_delta) of the encoding object block by subtracting a singlequantization parameter in the set (qp_prev_unit_1, qp_prev_unit_2,qp_prev_unit_3) of quantization parameters of the adjacent blocks thatare previously encoded from the quantization parameter (qp_curr_unit) ofthe encoding object block. Here, qp_prev_unit_1 may be a quantizationparameter of an encoding block at the left of the encoding object block,qp_prev_unit_2 may be a quantization parameter of an encoding block atthe upper of the encoding object block, and qp_prev_unit_3 may be aquantization parameter of an encoding block at the left upper of theencoding object block. Here, the apparatus for encoding an image maytransmit quantization parameter identification information indicatingwhat quantization parameter (that is, a predicted quantizationparameter) among the quantization parameters configuring the set ofquantization parameters was used to determine the residual quantizationparameter to the apparatus for decoding an image.

As another example, when a set of quantization parameters of adjacentblocks that are previously encoded is used, the apparatus for encodingan image may determine the residual quantization parameter(unit_qp_delta) of the encoding object block by subtracting a singlequantization parameter in the set (qp_prev_unit 1, qp_prev_unit 2,qp_prev_unit_3) of quantization parameters of the adjacent blocks thatare previously encoded from the quantization parameter (qp_curr_unit) ofthe encoding object block. Here, when the single quantization parameteris selected in the set of quantization parameters, a quantizationparameter having a median value in the set of quantization parametersmay be selected. Here, qp_prev_unit_1 may be a quantization parameter ofan encoding block at the left of the encoding object block,qp_prev_unit_2 may be a quantization parameter of an encoding block atthe upper of the encoding object block, and qp_prev_unit_3 may be aquantization parameter of an encoding block at the right upper of theencoding object block.

As another example, when a quantization parameter of a block that has adepth shallower than that of the encoding object block and is previouslyencoded among the predicted quantization parameters of the encodingobject block is used, the apparatus for encoding an image may determinethe residual quantization parameter (unit_qp_delta) of the encodingobject block by subtracting the quantization parameter (qp_prev_unit) ofthe block that has a depth shallower than that of the encoding objectblock and is previously encoded from the quantization parameter(qp_curr_unit) of the encoding object block.

As another example, when a quantization parameter of a block that has asize larger than that of the encoding object block and is previouslyencoded among the predicted quantization parameters of the encodingobject block is used, the apparatus for encoding an image may determinethe residual quantization parameter (unit_qp_delta) of the encodingobject block by subtracting the quantization parameter (qp_prev_unit) ofthe block that has a size larger than that of the encoding object blockand is previously encoded from the quantization parameter (qp_curr_unit)of the encoding object block.

As another example, the apparatus for encoding an image may determinethe residual quantization parameter (unit_qp_delta) of the encodingobject block by subtracting a quantization parameter (slice_qp_delta)defined in a slice header from the quantization parameter (qp_curr_unit)of the encoding object block.

As another example, in the presence of a quantization parameter(qp_left_unit) in a block present at the left of the encoding objectblock, the apparatus for encoding an image may determine the residualquantization parameter (unit_qp_delta) of the encoding object block bysubtracting the quantization parameter (qp_left_unit) of the blockpresent at the left from the quantization parameter (qp_curr_unit) ofthe encoding object block. Here, in the absence of the block at the leftof the encoding object block or in the absence of a quantizationparameter (qp_left_unit) in the block present at the left of theencoding object block, the apparatus for encoding an image may determinethe residual quantization parameter (unit_qp_delta) of the encodingobject block by subtracting the quantization parameter (qp_prevs_unit)of the block that is previously encoded in the encoding order from thequantization parameter (qp_curr_unit) of the encoding object block.

The residual quantization parameter of the encoding object block may bedetermined using at least one of the methods for determining theresidual quantization parameter of the encoding object block or acombination thereof.

Then, in operation (250), the apparatus for encoding an image may encodethe determined residual quantization parameter of the encoding objectblock.

As an example, the apparatus for encoding an image may entropy-encodethe residual quantization parameter of the encoding object block tothereby generate a bitstream. Here, when the apparatus for encoding animage and the apparatus for decoding an image previously knows theresidual quantization parameter of the encoding object block, operation(250) may be omitted in FIG. 2.

As another example, the apparatus for encoding an image may encode theresidual quantization parameter of the encoding object block by variousmethods for encoding the quantization parameter of the encoding objectblock in operation (130) of FIG. 1. In other words, the apparatus forencoding an image may encode the residual quantization parameter of theencoding object block using any one of the above-mentioned methods 1) to14). For example, in the case of using the method 1) or 2), theapparatus for encoding an image may encode a single residualquantization parameter per the LCTB or the SCTB. A process of encodingthe residual quantization parameter of the encoding object block usingany one of the methods 3) to 14) is overlapped with the process ofdetermining the quantization parameter in operation (130). Therefore, adetailed description thereof will be omitted. In addition, the apparatusfor encoding an image may encode the residual quantization parameter ofthe encoding object block using a combination of at least one of themethods for encoding the residual quantization parameter of the encodingobject block.

When the residual quantization parameter of the encoding object block isencoded, in the presence of a block having a depth deeper than aspecific depth of the block in which the residual quantization parameteris encoded, the apparatus for encoding an image may omit the encoding ofthe residual quantization parameter of the block having the deeperdepth. In addition, in the presence of a block having a size smallerthan a specific size of the block in which the residual quantizationparameter is encoded, the apparatus for encoding an image may omit theencoding of the residual quantization parameter of the block having thesmaller size.

FIG. 3 is a block diagram showing a configuration of an apparatus forencoding an image according to an embodiment of the present invention.

As shown in FIG. 3, an apparatus 300 for encoding an image may include aquantization parameter determinator 310 and an encoder 320.

The quantization parameter determinator 310 may determine a quantizationparameter of an encoding object block based on block information of theencoding object block. Here, the block information may include at leastone of a type of a block such as a prediction unit, a transform unit, orthe like, a size of the block, a depth of the block, and anencoding/decoding order of the block. Here, a process of determining thequantization parameter of the encoding object block according to theblock information has been described in detail in operations (110 and120) of FIG. 1. Therefore, an overlapped description thereof will beomitted.

The encoder 320 may entropy-encode at least one of the block informationof the encoding object block and the determined quantization parameterof the encoding object block to thereby generate a bitstream.

As an example, the encoder 320 may entropy-encode the block informationof the encoding object block in any one of a sequence parameter set(SPS), a picture parameter set (PPS), and a slice header in aconfiguration of the bitstream. In addition, the encoder 320 may encodethe quantization parameter of the encoding object block using any one ofthe methods 1) to 14) described in FIG. 1. Further, the encoder 320 mayencode the quantization parameter of the encoding object block using acombination of at least one of the methods for encoding the quantizationparameter of the encoding object block. Here, an operation of encodingthe quantization parameter of the encoding object block has beendescribed in detail in operation (130) of FIG. 1. Therefore, anoverlapped description thereof will be omitted.

When the quantization parameter of the encoding object block is encoded,in the presence of a block having a depth deeper than a specific depthof the block in which the quantization parameter is encoded, theapparatus for encoding an image may omit the encoding of thequantization parameter of the block having the deeper depth. Inaddition, in the presence of a block having a size smaller than aspecific size of the block in which the quantization parameter isencoded, the apparatus for encoding an image may omit the encoding ofthe quantization parameter of the block having the smaller size.

Here, when the apparatus for encoding an image and the apparatus fordecoding an image previously knows the block information of the encodingobject block, the encoder 320 may omit the process of entropy-encodingthe block information of the encoding object block. Likewise, when theapparatus for encoding an image and the apparatus for decoding an imagepreviously knows the quantization parameter of the encoding objectblock, the encoder 320 may omit the operation of entropy-encoding thequantization parameter of the encoding object block to thereby generatethe bitstream.

FIG. 4 is a block diagram showing a configuration of an apparatus forencoding an image determining a residual quantization parameteraccording to an embodiment of the present invention.

As shown in FIG. 4, an apparatus 400 for encoding an image may include aquantization parameter determinator 410, a predictor 420, a residualquantization parameter determinator 430, and an encoder 440. In FIG. 4,operations of the quantization parameter determinator 410 and theencoder 440 are the same as those of the quantization parameterdeterminator 310 and the encoder 320 of FIG. 3. Therefore, an overlappeddescription thereof will be omitted.

The predictor 420 may predict a quantization parameter of an encodingobject block.

For example, the predictor 420 may predict the quantization parameter ofthe encoding object block using any one of a quantization parameter thatis previously encoded before the encoding object block in an encodingorder, a quantization parameter of a block that is previously encodedbefore the encoding object block in the encoding order, a set ofquantization parameters that are previously encoded before the encodingobject block in the encoding order, a set of quantization parameters ofa block that is previously encoded before the encoding object block inthe encoding order, a quantization parameter that is previously encodedadjacent to the encoding object block, a set of quantization parametersthat are previously encoded adjacent to the encoding object block, and aset of quantization parameters of adjacent blocks.

As another example, the predictor 420 may predict the quantizationparameter of the encoding object block using quantization parameters ofblocks that have a depth shallower than that of the encoding objectblock among blocks that are previously encoded.

As another example, the predictor 420 may predict the quantizationparameter of the encoding object block using quantization parameters ofblocks that have a size larger than that of the encoding object blockamong blocks that are previously encoded.

As another example, the predictor 420 may predict the quantizationparameter of the encoding object block using a quantization parameterdefined in the SPS, the PPS, or the slice header.

As another example, the predictor 420 may determine a block having thesame spatial position as that of the encoding object block in apreviously encoded slice or a previously encoded picture and predict thequantization parameter of the encoding object block using a quantizationparameter of the determined block.

As another example, the predictor 420 may predict the quantizationparameter of the encoding object block using at least one ofquantization parameters of blocks that are encoded before the encodingobject block in a Z scan order and quantization parameters of blocksthat are present at the left based on the encoding object block and arepreviously encoded, as shown in FIG. 9.

Here, when a largest coding unit (LCU) quantization parameter ispredicted, the quantization parameter of the encoding object block maybe predicted from quantization parameters of blocks present in an LCUthat is encoded before the encoding object block in an encoding order ora raster scan order or quantization parameters of blocks present in anLCU present at the left or the upper of the encoding object block.

Here, when a LCU quantization parameter is predicted, the quantizationparameter of the encoding object block may be predicted usingquantization parameters of blocks that are encoded before the encodingobject block in a Z scan order or quantization parameters of adjacentblocks based on the encoding object block.

Here, when the LCU present at the leftmost portion within a slice or apicture, the quantization parameter of the encoding object block may bepredicted using one of a quantization parameter of the slice, aquantization parameter of the picture, quantization parameters of blockspresent in an LCU that is encoded before the encoding object block inthe encoding order or the raster scan order, and previously encodedquantization parameters of blocks previously present in the Z scanorder.

Numerals in blocks of FIG. 9 indicate an order in which the quantizationparameters are predicted. Within the LCU, the quantization parameter ofthe encoding object block may be predicted using the quantizationparameters of the blocks that are encoded before the encoding objectblock in the Z scan order, and between the LCUs, the quantizationparameter of the encoding object block may be predicted from thequantization parameters of the blocks present in the LCU that is encodedbefore the encoding object block in the encoding order or the rasterscan order.

As another example, the predictor 420 may predict the quantizationparameter of the encoding object block using quantization parameters ofblocks that are previously encoded according to similarity of encodingparameters. Here, the encoding parameter may be a size of a block, adepth of transform, motion merge, a motion vector predictor, an intraprediction direction, a prediction mode, a motion vector, a referencepicture index, a reference picture list, a coded block pattern, a codedblock flag, or the like. When the encoding object block has a size ofN×M, the quantization parameter may be predicted using blocks having asize of N×M among blocks adjacent to the encoding object block. When theencoding object block has a transform depth of N, the quantizationparameter may be predicted using blocks having a transform depth of Namong the blocks adjacent to the encoding object block. When motionmerge is performed on the encoding object block, the quantizationparameter may be predicted using blocks that become motion mergeobjects. When the encoding object block uses the motion vectorpredictor, the quantization parameter may be predicted using a blockindicated by the corresponding motion vector predictor. When theencoding object block is intra encoded, the quantization parameter ofthe encoding object block may be predicted using quantization parametersof blocks encoded in the same intra prediction direction as or similarintra prediction direction to a corresponding intra predictiondirection. When the encoding object block is intra encoded usingrestored pixels of upper blocks based on the encoding object block, thequantization parameter of the encoding object block may be predictedusing quantization parameters of the upper blocks, and when the encodingobject block is intra encoded using restored pixels of left blocks basedon the encoding object block, the quantization parameter of the encodingobject block may be predicted using quantization parameters of the leftblocks. When the encoding object block is intra encoded, thequantization parameter of the encoding object block may be predictedusing blocks used to encode an intra prediction mode (direction) of theencoding object block among the blocks adjacent to the encoding objectblock. For example, when an intra prediction mode of any one of the leftblocks and the upper blocks based on the encoding object block is usedin encoding the intra prediction mode of the encoding object block, thequantization parameter of the encoding object block may be predictedusing quantization parameters of the used prediction block. Thequantization parameter of the encoding object block may be predictedusing quantization parameters of blocks encoded in the same predictionmode as that of the encoding object block. For example, when theencoding object block is inter encoded, the quantization parameter ofthe encoding object block may be predicted using quantization parametersof blocks encoded in an inter prediction mode among blocks adjacent tothe encoding object block, and when the encoding object block is intraencoded, the quantization parameter of the encoding object block may bepredicted using quantization parameters of blocks encoded in the intraprediction mode among the blocks adjacent to the encoding object block.Here, in the presence of a plurality of blocks encoded in the sameprediction mode as that of the encoding object block, quantizationparameters of the plurality of blocks may be used to predict thequantization parameter of the encoding object block. When the encodingobject block is inter encoded, the quantization parameter of theencoding object block may be predicted using quantization parameters ofblocks within a reference picture indicated by motion information of theencoding object block using a motion vector, a reference picture index,and a reference picture list, which correspond to the motioninformation. Here, when the encoding object block has at least twomotion information, the number of quantization parameters of blockswithin the reference picture may be at least two. When a residual signalis not present in a block that is previously encoded and a coded blockpattern or a coded block flag is thus 0, a quantization parameter of acorresponding block may not be used to predict the quantizationparameter of the encoding object block. Here, the fact that the codedblock pattern or the coded block flag is 0 means that residual signalsof a luminance component and a chrominance component are not encoded ora residual signal of a luminance component is not encoded.

The quantization parameter of the encoding object block may be predictedusing at least one of the methods for predicting the quantizationparameter of the encoding object block or a combination thereof.

The residual quantization parameter determinator 430 may determine aresidual quantization parameter of the encoding object block using thequantization parameter of the encoding object block and the predictedquantization parameter of the encoding object block.

As an example, the residual quantization parameter determinator 430 maydetermine the residual quantization parameter of the encoding objectblock by subtracting the predicted quantization parameter of theencoding object block from the quantization parameter of the encodingobject block.

As another example, the residual quantization parameter determinator 430may calculate the average of the predicted quantization parameters ofthe encoding object block. In addition, the residual quantizationparameter determinator 430 may determine the residual quantizationparameter of the encoding object block by subtracting the average of thepredicted quantization parameters of the encoding object block from thequantization parameter of the encoding object block.

The residual quantization parameter of the encoding object block may bedetermined using at least one of the methods for determining theresidual quantization parameter of the encoding object block or acombination thereof.

Meanwhile, the encoder 440 may encode at least one of the residualquantization parameter of the encoding object block and the blockinformation of the encoding object block.

As an example, the encoder 440 may entropy-encode the residualquantization parameter of the encoding object block and the blockinformation of the encoding object block to thereby generate abitstream. Here, when the apparatus for encoding an image and theapparatus for decoding an image previously know the block information ofthe encoding object block, the encoder 440 may entropy-encode only theresidual quantization parameter of the encoding object block to therebygenerate the bitstream.

As an example, the encoder 440 may entropy-encode the block informationof the encoding object block in any one of a sequence parameter set(SPS), a picture parameter set (PPS), and a slice header in aconfiguration of the bitstream. In addition, the encoder 440 may encodethe residual quantization parameter of the encoding object block usingany one of the methods 1) to 14) described in FIG. 1. In addition, theapparatus for encoding an image may encode the residual quantizationparameter of the encoding object block using a combination of at leastone of the methods for encoding the residual quantization parameter ofthe encoding object block.

When the residual quantization parameter of the encoding object block isencoded, in the presence of a block having a depth deeper than aspecific depth of the block in which the residual quantization parameteris encoded, the apparatus for encoding an image may omit the encoding ofthe residual quantization parameter of the block having the deeperdepth. In addition, in the presence of a block having a size smallerthan a specific size of the block in which the residual quantizationparameter is encoded, the apparatus for encoding an image may omit theencoding of the residual quantization parameter of the block having thesmaller size.

FIG. 5 is a flow chart provided in order to describe a method fordecoding an image according to an embodiment of the present invention.

First, in operation (510), an apparatus for decoding an image may decodeblock information of a decoding object block.

For example, the apparatus for decoding an image may demultiplex thebitstream received from the apparatus for encoding an image to therebyextract the encoded block information of the decoding object block. Inaddition, the apparatus for decoding an image may entropy-decode theencoded block information of the decoding object block. Here, theencoded block information of the decoding object block included in thebitstream is the same as the block information of the encoding objectblock encoded in the apparatus for encoding an image.

As another example, the apparatus for decoding an image mayentropy-decode the block information of the decoding object blockincluded in any one of a sequence parameter set (SPS), a pictureparameter set (PPS), and a slice header in a configuration of thebitstream.

More specifically, the apparatus for decoding an image mayentropy-decode the block information such as max_coding_unit_widthindicating a maximum width in a size of a coding unit,max_coding_unit_width indicating a maximum width in a size of a codingunit, max_coding_unit_height indicating a maximum height in the size ofthe coding unit, max_coding_unit_hierarchy_depth indicating a maximumhierarchy depth of the coding unit, log2_min_coding_unit_size_minus3indicating a minimum size of the coding unit,log2_min_transform_unit_size_minus2 indicating a minimum size of atransform unit, max_transform_unit_hierarchy_depth indicating a maximumhierarchy depth of the transform unit,log2_diff_max_min_coding_block_size indicating a difference betweenminimum and maximum sizes of the coding unit,log2_diff_max_min_transform_block_size indicating a difference betweenminimum and maximum sizes of the transform unit,max_transform_hierarchy_depth_inter indicating a maximum depth of aninter encoded transform unit, max_transform_hierarchy_depth_intraindicating a maximum depth of an intra encoded transform unit, and thelike, which correspond to information of the blocks encoded in the SPS,the PPS, or the slice header.

As another example, when the apparatus for decoding an image previouslyknows the block information of the decoding object block, it may omitthe process of entropy-decoding the block information of the decodingobject block from the bitstream. That is, when the apparatus fordecoding an image previously knows the block information of the decodingobject block, operation (510) may be omitted in FIG. 5. For example,when the apparatus for decoding an image previously knows informationassociated with sizes of blocks such as a height, a width, and the like,of a coding unit, a prediction unit, or a transform unit, it may notentropy-decode the block information of the decoding object block fromthe bitstream.

The block information of the decoding object block may be decoded usingat least one of the methods for decoding the block information of thedecoding object block or a combination thereof.

Then, in operation (520), the apparatus for decoding an image may decodea quantization parameter of the decoding object block from the bitstreambased on the block information of the decoding object block.

As an example, when the apparatus for decoding an image does notpreviously know the quantization parameter of the decoding object block,it may entropy-decode the quantization parameter of the decoding objectblock from the bitstream. Here, when the apparatus for decoding an imagepreviously knows the quantization parameter of the decoding objectblock, it may omit the operation of entropy-decoding the quantizationparameter of the decoding object block.

Hereinafter, a process of decoding a quantization parameter of adecoding object block based on block information of a decoding objectblock will be described in more detail by way of example.

1) First, the apparatus for decoding an image may decode a singlequantization parameter per LCTB, LCU, SCTB, or SCU.

2) In addition, the apparatus for decoding an image may decode a singlequantization parameter per a prediction unit regardless of a size or adepth of the prediction unit.

3) In addition, the apparatus for decoding an image may decode a singlequantization parameter per a transform unit regardless of a size or adepth of the transform unit.

4) In addition, the apparatus for decoding an image may decode a singlequantization parameter at a specific depth or a specific size of thecoding unit, at a specific depth or a specific size of the predictionunit, or at a specific depth or a specific size of the transform unit. Amore detailed configuration will be described below with reference toTable 1, Table 2, Table 3, Table 4, Table 6, Table 7, Table 8, Table 9,Table 10, Table 11, Table 12, Table 13, and Table 14.

5) In addition, the apparatus for decoding an image may decode aquantization parameter based on block information of a decoding objectblock defined in a PPS, a SPS, or a slice header.

6) In addition, the apparatus for decoding an image may decode aquantization parameter of a decoding object block based on whether ornot a residual signal to be decoded included in the decoding objectblock is present.

7) In addition, the apparatus for decoding an image may decode aquantization parameter of a decoding object block using an equation or avalue derived based on block information of the decoding object block.

8) In addition, the apparatus for decoding an image may decode a singlequantization parameter using any one of a size of a transform unit(log2_min_transform_unit_size_minus2), a depth of the transform unit(max_transform_unit_hierarchy_depth), log2_diffmax_min_coding_block_size indicating a difference between minimum andmaximum sizes of a coding unit, log2_min_transform_block_size_minus2indicating a minimum size of the transform unit (a transform block),log2_diff_max_min_transform_block_size indicating a difference betweenminimum and maximum sizes of the transform unit,max_transform_hierarchy_depth_inter indicating a maximum depth of aninter encoded transform unit, and max_transform_hierarchy_depth_intraindicating a maximum depth of an intra encoded transform unit that aredefined in the SPS, PPS, or the slice header.

9) In addition, the apparatus for decoding an image may decode a singlequantization parameter using any one of a size of a coding unit(log2_min_coding_unit_size_minus3), a depth of the coding unit(max_coding_unit_hierarchy_depth), log2_diff_max_min_coding_block_sizeindicating a difference between minimum and maximum sizes of the codingunit, log2_min_transform_block_size_minus2 indicating a minimum size ofthe transform unit (a transform block),log2_diff_max_min_transform_block_size indicating a difference betweenminimum and maximum sizes of the transform unit,max_transform_hierarchy_depth_inter indicating a maximum depth of aninter encoded transform unit, and max_transform_hierarchy_depth_intraindicating a maximum depth of an intra encoded transform unit that aredefined in the SPS, PPS, or the slice header.

10) In addition, the apparatus for decoding an image may decode aquantization parameter of a decoding object block within a sequence,within a picture, within a slice, within a LCTB, or the like. Here, theapparatus for decoding an image may determine and change thequantization parameter only in a corresponding unit using quantizationparameter changeable information representing a change unit. Forexample, the apparatus for decoding an image may decode a syntax elementassociated with the quantization parameter changeable information. Inaddition, when a logical value of the decoded syntax element is 1, theapparatus for decoding an image may change the quantization parameter ina unit (a slice, a coding unit (CU), a prediction unit (PU), a transformunit (TU), and the like) lower than a picture and set the quantizationparameter in the decoding object block according to the changed value.In addition, when the logical value of the decoded syntax element is 0,the apparatus for decoding an image may not change the quantizationparameter in the unit lower than the picture.

11) In addition, when the apparatus for decoding an image determines thequantization parameter of the decoding object block using theabove-mentioned methods 1) to 10), it may decode a syntax elementrepresenting information of the quantization parameter together with asize or a depth of a block from the PPS, the SPS, or the slice header.When the apparatus for decoding an image decodes the quantizationparameter of the decoding object block using an equation or a valuederived based on the block information, a size of a depth of thetransform unit, or a size or a depth of the prediction unit, it maydecode the syntax element representing the information of thequantization parameter together with the size or the depth of the blockfrom the PPS, the SPS, or the slice header. Further, the apparatus fordecoding an image may decode the quantization parameter only up to at aspecific depth or a specific size of the block according to depths orsizes of each of the coding unit, the prediction unit, and the transformunit based on the block information of the decoding object block. Here,in the presence of a block having a depth deeper than a specific depthof the block in which the quantization parameter is decoded, theapparatus for decoding an image may set a quantization parameter of theblock having the deeper depth so as to be the same as the quantizationparameter set at the specific depth. In addition, qp_hierarchy_depth orlog2_qp_unit_size may be individually applied to each of the codingunit, the prediction unit, and the transform unit. Here,qp_hierarchy_depth indicates a syntax element representing a specificdepth of the block in which the quantization parameter is set, andlog2_qp_unit_size indicates a syntax element representing a specificsize of the block in which the quantization parameter is set. A moredetailed configuration will be described below with reference to Table1, Table 2, Table 3, Table 4, Table 6, Table 7, Table 8, Table 9, Table10, Table 11, Table 12, Table 13, and Table 14.

The quantization parameter of the decoding object block may be decodedby at least one of the methods for decoding the quantization parameterof the decoding object block or a combination thereof.

When the quantization parameter of the decoding object block is decoded,in the presence of a block having a depth deeper than a specific depthof the block in which the quantization parameter is decoded, theapparatus for decoding an image may omit the decoding of thequantization parameter of the block having the deeper depth. Inaddition, in the presence of a block having a size smaller than aspecific size of the block in which the quantization parameter isdecoded, the apparatus for decoding an image may omit the decoding ofthe quantization parameter of the block having the smaller size.

Again, in operation (530), the apparatus for decoding an image may setthe quantization parameter in the decoding object block as thequantization parameter of the decoding object block is decoded.

Here, the apparatus for decoding an image may set the quantizationparameter in the decoding object block using the methods 1) to 11)described in operation (520). For example, in the case of using themethod 1) or 2), the apparatus for decoding an image may set a singlequantization parameter per the LCTB or the SCTB. The apparatus fordecoding an image may set the quantization parameter in the decodingobject block using any one of the methods 3) to 11) in the same scheme.Further, the apparatus for decoding an image may set the quantizationparameter in the decoding object block using a combination of at leastone of the methods for setting the quantization parameter of thedecoding object block.

When the quantization parameter of the decoding object block is set, inthe presence of a block having a depth deeper than a specific depth ofthe block in which the quantization parameter is set, the apparatus fordecoding an image may set the quantization parameter of the block havingthe deeper depth so as to be the same as the quantization parameter setat the specific depth. In addition, in the presence of a block having asize smaller than a specific size of the block in which the quantizationparameter is set, the apparatus for decoding an image may set aquantization parameter of the block having the smaller size so as to bethe same as the quantization parameter set at the specific size.

FIG. 6 is a flow chart provided in order to describe a method fordecoding an image based on a residual quantization parameter accordingto an embodiment of the present invention.

First, in operation (610), an apparatus for decoding an image may decodeblock information of a decoding object block. Here, a process ofoperation (610) is the same as that of operation (510) described abovein FIG. 5. Therefore, an overlapped description thereof will be omitted.

Next, in operation (620), the apparatus for decoding an image may decodea residual quantization parameter of the decoding object block from abitstream.

As an example, the apparatus for decoding an image may demultiplex thebitstream to thereby extract the encoded residual quantization parameterof the decoding object block. In addition, the apparatus for decoding animage may entropy-decode the encoded residual quantization parameter ofthe decoding object block. Here, when the apparatus for decoding animage previously knows the quantization parameter of the decoding objectblock, it may omit the process of entropy-decoding the encoded residualquantization parameter of the decoding object block.

As another example, the apparatus for decoding an image may decode theresidual quantization parameter using any one of the methods 1) to 11)described in operation (520) of FIG. 5. Here, in the case of using themethod 6), the apparatus for decoding an image may not decode theresidual quantization parameter of the decoding object block since aresidual signal to be decoded is not present within the decoding objectblock. In addition, the apparatus for decoding an image may decode theresidual quantization parameter of the decoding object block using acombination of at least one of the methods for decoding the residualquantization parameter of the decoding object block.

When the residual quantization parameter of the decoding object block isdecoded, in the presence of a block having a depth deeper than aspecific depth of the block in which the residual quantization parameteris decoded, the apparatus for decoding an image may omit the decoding ofthe residual quantization parameter of the block having the deeperdepth. In addition, in the presence of a block having a size smallerthan a specific size of the block in which the residual quantizationparameter is decoded, the apparatus for decoding an image may omit thedecoding of the residual quantization parameter of the block having thesmaller size.

Next, in operation (630), the apparatus for decoding an image maypredict a quantization parameter of the decoding object block.

As an example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using any one of aquantization parameter that is previously decoded before the decodingobject block in a decoding order, a quantization parameter of a blockthat is previously decoded before the decoding object block in thedecoding order, a set of quantization parameters that are previouslydecoded before the decoding object block in the decoding order, and aquantization parameter of a block that is previously decoded before thedecoding object block in the decoding order.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using any one of aquantization parameter that is previously decoded adjacent to thedecoding object block, a set of quantization parameters that arepreviously decoded adjacent to the decoding object block, quantizationparameters of adjacent blocks that are previously decoded, and a set ofquantization parameters of adjacent blocks that are previously decoded.Here, the adjacent blocks that are previously decoded mean blocks thatare previously decoded among blocks positioned spatially adjacent to thedecoding object block.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using quantizationparameters of blocks that have a depth shallower than that of thedecoding object block among blocks that are previously decoded. Here,the block used to predict the quantization parameter may include atleast one of a block that is decoded before the decoding object block inthe decoding order and a block that has a depth shallower than that ofthe decoding object block. Here, the block that has a depth shallowerthan that of the decoding object block may be previously decoded beforethe decoding object block.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using quantizationparameters of blocks that have a size larger than that of the decodingobject block among blocks that are previously decoded. Here, the blockused to predict the quantization parameter may include at least one of ablock that is decoded before the decoding object block in the decodingorder and a block that has a size larger than that of the decodingobject block. Here, the block that has a size larger than that of thedecoding object block may be previously decoded before the decodingobject block.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using a quantizationparameter of the decoding object block defined in the SPS, the PPS, orthe slice header.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using a quantizationparameter of a block having the same spatial position as that of thedecoding object block in a slice or a picture that is previouslydecoded.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using at least oneof quantization parameters of blocks that are decoded before thedecoding object block in a Z scan order and quantization parameters ofblocks that are present at the left based on the decoding object blockand are previously decoded, as shown in FIG. 9.

Here, when a largest coding unit (LCU) quantization parameter ispredicted, the quantization parameter of the decoding object block maybe predicted from quantization parameters of blocks present in an LCUthat is decoded before the decoding object block in a decoding order ora raster scan order or quantization parameters of blocks present in anLCU present at the left or the upper of the decoding object block.

Here, when a LCU quantization parameter is predicted, the quantizationparameter of the decoding object block may be predicted usingquantization parameters of blocks that are decoded before the decodingobject block in a Z scan order or quantization parameters of adjacentblocks based on the decoding object block.

Here, when the LCU is present at the leftmost portion within a slice ora picture, the quantization parameter of the decoding object block maybe predicted using one of a quantization parameter of the slice, aquantization parameter of the picture, quantization parameters of blockspresent in an LCU that is decoded before the decoding object block inthe decoding order or the raster scan order, and previously decodedquantization parameters of blocks previously present in the Z scanorder.

Numerals in blocks of FIG. 9 indicate an order in which the quantizationparameters are predicted. Within the LCU, the quantization parameter ofthe decoding object block may be predicted using the quantizationparameters of the blocks that are decoded before the decoding objectblock in the Z scan order, and between the LCUs, the quantizationparameter of the decoding object block may be predicted from thequantization parameters of the blocks present in the LCU that is decodedbefore the decoding object block in the decoding order or the rasterscan order.

As another example, the apparatus for decoding an image may predict thequantization parameter of the decoding object block using quantizationparameters of blocks that are previously decoded according to similarityof decoding parameters. Here, the decoding parameter may be a size of ablock, a depth of transform, motion merge, a motion vector predictor, anintra prediction direction, a prediction mode, a motion vector, areference picture index, a reference picture list, a coded blockpattern, a coded block flag, or the like. When the decoding object blockhas a size of N×M, the quantization parameter may be predicted usingblocks having a size of N×M among blocks adjacent to the decoding objectblock. When the decoding object block has a transform depth of N, thequantization parameter may be predicted using blocks having a transformdepth of N among the blocks adjacent to the decoding object block. Whenmotion merge is performed on the decoding object block, the quantizationparameter may be predicted using blocks that become motion mergeobjects. When the decoding object block uses the motion vectorpredictor, the quantization parameter may be predicted using a blockindicated by the corresponding motion vector predictor. When thedecoding object block is intra decoded, the quantization parameter ofthe decoding object block may be predicted using quantization parametersof blocks decoded in the same intra prediction direction as or similarintra prediction direction to a corresponding intra predictiondirection. When the decoding object block is intra decoded usingrestored pixels of upper blocks based on the decoding object block, thequantization parameter of the decoding object block may be predictedusing quantization parameters of the upper blocks, and when the decodingobject block is intra decoded using restored pixels of left blocks basedon the decoding object block, the quantization parameter of the decodingobject block may be predicted using quantization parameters of the leftblocks. When the decoding object block is intra decoded, thequantization parameter of the decoding object block may be predictedusing blocks used to decode an intra prediction mode (direction) of thedecoding object block among the blocks adjacent to the decoding objectblock. For example, when an intra prediction mode of any one of the leftblocks and the upper blocks based on the decoding object block is usedin decoding the intra prediction mode of the decoding object block, thequantization parameter of the decoding object block may be predictedusing quantization parameters of the used prediction block. Thequantization parameter of the decoding object block may be predictedusing quantization parameters of blocks decoded in the same predictionmode as that of the decoding object block. For example, when thedecoding object block is inter decoded, the quantization parameter ofthe decoding object block may be predicted using quantization parametersof blocks decoded in an inter prediction mode among blocks adjacent tothe decoding object block, and when the decoding object block is intradecoded, the quantization parameter of the decoding object block may bepredicted using quantization parameters of blocks decoded in the intraprediction mode among the blocks adjacent to the decoding object block.Here, in the presence of a plurality of blocks decoded in the sameprediction mode as that of the decoding object block, quantizationparameters of the plurality of blocks may be used to predict thequantization parameter of the decoding object block. When the decodingobject block is inter decoded, the quantization parameter of thedecoding object block may be predicted using quantization parameters ofblocks within a reference picture indicated by motion information of thedecoding object block using a motion vector, a reference picture index,and a reference picture list, which correspond to the motioninformation. Here, when the decoding object block has at least twomotion information, the number of quantization parameters of blockswithin the reference picture may be at least two. When a residual signalis not present in a block that is previously decoded and a coded blockpattern or a coded block flag is thus 0, a quantization parameter of acorresponding block may not be used to predict the quantizationparameter of the decoding object block. Here, the fact that the codedblock pattern or the coded block flag is 0 means that residual signalsof a luminance component and a chrominance component are not decoded ora residual signal of a luminance component is not decoded.

The quantization parameter of the decoding object block may be predictedusing at least one of the methods for predicting the quantizationparameter of the decoding object block or a combination thereof.

Then, in operation (640), the apparatus for decoding an image maydetermine the quantization parameter of the decoding object block usingthe predicted quantization parameter of the decoding object block andthe residual quantization parameter of the decoding object block.

Here, the apparatus for decoding an image may calculate the average ofthe predicted quantization parameters of the decoding object block anddetermine the quantization parameter of the decoding object block byadding the calculated average to the residual quantization parameter ofthe decoding object block.

In addition, the apparatus for decoding an image may also determine thequantization parameter of the decoding object block by adding thepredicted quantization parameter to the residual quantization parameter.

As an example, when a quantization parameter of a block that ispreviously decoded in the decoding order is used as the predictedquantization parameter, the apparatus for decoding an image maydetermine the quantization parameter of the decoding object block byadding the quantization parameter of the block that is previouslydecoded in the decoding order to the residual quantization parameter.

As another example, when a set of quantization parameters of a blockthat is previously decoded in the decoding order is used as thepredicted quantization parameter, the apparatus for decoding an imagemay determine the quantization parameter of the decoding object block byadding any one of the quantization parameters configuring the set ofquantization parameters of the block that is previously decoded in thedecoding order to the residual quantization parameter. Here, whenquantization parameter identification information is received from theapparatus for encoding an image, the apparatus for decoding an image mayselect a quantization parameter corresponding to the quantizationparameter identification information among the quantization parametersconfiguring the set of quantization parameters of the block that ispreviously decoded in the decoding order. Then, the apparatus fordecoding an image may determine the quantization parameter of thedecoding object block by adding the selected quantization parameter tothe residual quantization parameter.

As another example, when a quantization parameter of a block that ispreviously decoded at an upper of the decoding object block is used asthe predicted quantization parameter, the apparatus for decoding animage may determine the quantization parameter of the decoding objectblock by adding the quantization parameter of the block that ispreviously decoded at the upper of the decoding object block to theresidual quantization parameter.

As another example, when a set of quantization parameters of adjacentblocks is used as the predicted quantization parameter, the apparatusfor decoding an image may determine the quantization parameter of thedecoding object block by adding any one of the quantization parametersconfiguring the set of quantization parameters of the adjacent blocks tothe residual quantization parameter. Here, when the quantizationparameter identification information is received from the apparatus forencoding an image, the apparatus for decoding an image may select aquantization parameter corresponding to the quantization parameteridentification information among the quantization parameters configuringthe set of quantization parameters of the adjacent blocks. Then, theapparatus for decoding an image may determine the quantization parameterof the decoding object block by adding the selected quantizationparameter to the residual quantization parameter.

As another example, when a set of quantization parameters of adjacentblocks is used as the predicted quantization parameter, the apparatusfor decoding an image may determine the quantization parameter of thedecoding object block by adding any one of the quantization parametersconfiguring the set of quantization parameters of the adjacent blocks tothe residual quantization parameter. Here, when any one of thequantization parameters is used, a quantization parameter having amedian value in the set of quantization parameters may be selected.

As another example, when a depth is used as the predicted quantizationparameter, the apparatus for decoding an image may determine thequantization parameter of the decoding object block by addingquantization parameters of blocks that have a depth shallower than thatof the decoding object block among the blocks that are previouslydecoded to the residual quantization parameter. Here, the block used topredict the quantization parameter may include at least one of a blockthat is decoded before the decoding object block in the decoding orderand a block that has a depth shallower than that of the decoding objectblock.

As another example, when a size is used as the predicted quantizationparameter, the apparatus for decoding an image may determine thequantization parameter of the decoding object block by addingquantization parameters of blocks that have a size larger than that ofthe decoding object block among the blocks that are previously decodedto the residual quantization parameter. Here, the block used to predictthe quantization parameter may include at least one of a block that isdecoded before the decoding object block in the decoding order and ablock that has a size larger than that of the decoding object block.

As another example, when a quantization parameter defined in a sliceheader is used as the predicted quantization parameter, the apparatusfor decoding an image may determine the quantization parameter of thedecoding object block by adding the quantization parameter defined inthe slice header to the residual quantization parameter.

As another example, in the presence of a quantization parameter in ablock present at the left of the decoding object block, the apparatusfor decoding an image may determine the quantization parameter of thedecoding object block by adding the quantization parameter of the blockpresent at the left of the decoding object block to the residualquantization parameter. Here, in the absence of the block at the left ofthe decoding object block or in the absence of a quantization parameterin the block present at the left of the decoding object block, theapparatus for decoding an image may determine the quantization parameterof the decoding object block by adding the quantization parameter of theblock that is previously decoded in the decoding order to the residualquantization parameter.

The quantization parameter of the decoding object block may bedetermined by at least one of the methods for determining thequantization parameter of the decoding object block or a combinationthereof.

Next, in operation (650), the apparatus for decoding an image may setthe quantization parameter of the decoding object block in the decodingobject block based on the determined quantization parameter of thedecoding object block. Here, a process of operation (650) is the same asthat of operation (530) of FIG. 5. Therefore, an overlapped descriptionthereof will be omitted.

FIG. 7 is a block diagram showing a configuration of an apparatus fordecoding an image according to an embodiment of the present invention.

As shown in FIG. 7, an apparatus 700 for decoding an image may include adecoder 710 and a quantization parameter setter 720.

The decoder 710 may decode at least one of block information of adecoding object block and an encoded quantization parameter of thedecoding object block.

As an example, the decoder 710 may entropy-decode encoded blockinformation of the decoding object block extracted from the bitstreamthrough demultiplexing. In addition, the decoder 710 may entropy-decodethe encoded quantization parameter of the decoding object block based onthe decoded block information.

As an example, the decoder 710 may entropy-decode the block informationof the decoding object block in any one of a sequence parameter set(SPS), a picture parameter set (PPS), and a slice header in aconfiguration of the bitstream. In addition, the decoder 710 may decodethe block information of the decoding object block and the quantizationparameter of the decoding object block according to the method describedin operations (510 and 520) of FIG. 5. A process of decoding the blockinformation of the decoding object block and the quantization parameterof the decoding object block is the same as the process described inoperations (510 and 520) of FIG. 5. Therefore, an overlapped descriptionthereof will be omitted.

Here, when the apparatus for decoding an image previously knows theblock information of the decoding object block, the decoder 710 may omitthe operation of entropy-decoding the block information of the decodingobject block from the bitstream. Likewise, when the apparatus fordecoding an image previously knows the quantization parameter of thedecoding object block, the decoder 710 may omit the operation ofentropy-decoding the encoded quantization parameter of the decodingobject block.

The quantization parameter setter 720 may set the quantization parameterin the decoding object block based on the decoded quantization parameterof the decoding object block. Here, an operation of setting thequantization parameter in the decoding object block has been describedin detail in operation (530) of FIG. 5. Therefore, an overlappeddescription thereof will be omitted.

FIG. 8 is a block diagram showing a configuration of an apparatus fordecoding an image based on a residual quantization parameter accordingto an embodiment of the present invention.

As shown in FIG. 8, an apparatus 800 for decoding an image may include adecoder 810, a predictor 820, a quantization parameter determinator 830,and a quantization parameter setter 840.

The decoder 810 may decode at least one of block information of adecoding object block and an encoded residual quantization parameter ofthe decoding object block.

As an example, the decoder 810 may entropy-decode encoded blockinformation of the decoding object block extracted from a bitstreamthrough demultiplexing. In addition, the decoder 810 may entropy-decodethe encoded residual quantization parameter of the decoding object blockbased on the decoded block information.

Here, when the apparatus for decoding an image previously knows theblock information of the decoding object block, the decoder 810 may omitthe operation of entropy-decoding the block information of the decodingobject block from the bitstream. Likewise, when the apparatus fordecoding an image previously knows the quantization parameter of thedecoding object block, the decoder 810 may omit the operation ofentropy-decoding the encoded residual quantization parameter of thedecoding object block.

The decoder 810 may decode the block information of the decoding objectblock and the residual quantization parameter of the decoding objectblock according to the method described in operations (510 and 520) ofFIG. 5. A process of decoding the block information of the decodingobject block and the residual quantization parameter of the decodingobject block is the same as the process described in operations (510 and520) of FIG. 5. Therefore, an overlapped description thereof will beomitted.

The predictor 820 may predict a quantization parameter of a decodingobject block. Here, an operation of predicting the quantizationparameter has been described in detail in operation (630) of FIG. 6.Therefore, an overlapped description thereof will be omitted.

The quantization parameter determinator 830 may determine a quantizationparameter of the decoding object block based on the predictedquantization parameter of the decoding object block and the residualquantization parameter of the decoding object block.

As an example, the quantization parameter determinator 830 may determinethe quantization parameter of the decoding object block by adding thepredicted quantization parameter to the residual quantization parameter.Here, various operations of determining the quantization parameter ofthe decoding object block according to the predicted quantizationparameter have been described in detail in operation (640) of FIG. 6.Therefore, an overlapped description thereof will be omitted.

As another example, the quantization parameter determinator 830 maycalculate the average of the predicted quantization parameters anddetermine the quantization parameter of the decoding object block byadding the calculated average to the residual quantization parameter.

The quantization parameter setter 840 may set the quantization parameterin the decoding object block based on the determined quantizationparameter of the decoding object block. Here, an operation of settingthe quantization parameter in the decoding object block has beendescribed in detail in operation (650) of FIG. 6. Therefore, anoverlapped description thereof will be omitted.

When a residual signal is not present in a specific block or when thespecific block is encoded in a pulse coded modulation (PCM) scheme, aquantization parameter of the specific block may be regarded as 0. Thatis, it may be determined that the specific block is a block in which aquantization parameter is not present.

The sequence parameter set (SPS) described above in FIGS. 1 to 8 mayhave a configuration as shown in the following Tables 1 to 3.Hereinafter, a quantization parameter will be used to generallyrepresent a residual quantization parameter as well as a quantizationparameter.

Table 1 shows an example of a sequence parameter set (SPS) including asyntax element representing quantization parameter information based ona depth or a size of a block.

TABLE 1 C Descriptor seq_parameter_set_rbsp( ) { profile_idc 0 u(8) ...log2_min_coding_unit_size_minus3 0 ue(v)log2_diff_max_min_coding_unit_size 0 ue(v) ...log2_min_transform_size_minus2 0 ue(v) log2_diff_max_min_transform_size0 ue(v) max_transform_hierarchy_depth_inter 0 ue(v)max_transform_hierarchy_depth_intra 0 ue(v) qp_hierarchy_depth 0 ue(v)log2_qp_unit_size 0 ue(v) ... rbsp_trailing_bits( ) 0 }

In Table 1, qp_hierarchy_depth indicates a syntax element representing aspecific depth of a block in which a quantization parameter is set,encoded, or decoded, and log2_qp_unit_size indicates a syntax elementrepresenting a specific size of a block in which a quantizationparameter is set, encoded, or decoded. Here, the SPS may include onlyany one syntax element of qp_hierarchy_depth and log2_qp_unit_size.

For example, when qp_hierarchy_depth is 1, a quantization parameter maybe set, encoded, or decoded only with respect to a transform unit havingdepths of 0 and 1, which are depths of 1 or less, within a sequence. Inthe presence of block having a depth deeper than 1, which is a depth ofa block in which a quantization parameter is set, it is possible to seta quantization parameter of the block having the deeper depth so as tobe the same as the quantization parameter set at the depth of 1.

For example, when log2_qp_unit_size is 3, a quantization parameter maybe set, encoded, or decoded only with respect to a block having a sizeof 8×8 or more, within a sequence. In the presence of a block having asize smaller than 8×8, which is a size of a block in which aquantization parameter is set, it is possible to set a quantizationparameter of the block having the smaller size so as to be the same asthe quantization parameter set at the size of 8×8.

Table 2 shows an example of a sequence parameter set (SPS) including asyntax element representing quantization parameter information based ona depth of a block in an inter-slice or an intra-slice.

TABLE 2 C Descriptor seq_parameter_set_rbsp( ) { profile_idc 0 u(8) ...log2_min_coding_unit_size_minus3 0 ue(v)log2_diff_max_min_coding_unit_size 0 ue(v) ...log2_min_transform_size_minus2 0 ue(v) log2_diff_max_min_transform_size0 ue(v) max_transform_hierarchy_depth_inter 0 ue(v)max_transform_hierarchy_depth_intra 0 ue(v) qp_hierarchy_depth_inter 0ue(v) qp_hierarchy_depth_intra 0 ue(v) ... rbsp_trailing_bits( ) 0 }

In Table 2, qp_hierarchy_depth_inter indicates a syntax elementrepresenting a specific depth of a block in which a quantizationparameter is set, encoded, or decoded in an inter-slice, andqp_hierarchy_depth_intra indicates a syntax element representing aspecific depth of a block in which a quantization parameter is set,encoded, or decoded in an intra-slice. Here, the SPS may include onlyany one syntax element of qp_hierarchy_depth_inter andqp_hierarchy_depth_intra.

For example, when qp_hierarchy_depth_inter is 1, a quantizationparameter may be set, encoded, or decoded only with respect to atransform unit having depths of 0 and 1, which are depths of 1 or less,in an inter-slice within a sequence. In the presence of a block having adepth deeper than 1, which is a depth of a block in which a quantizationparameter is set, it is possible to set a quantization parameter of theblock having the deeper depth so as to be the same as the quantizationparameter set at the depth of 1.

For example, when qp_hierarchy_depth_intra is 2, a quantizationparameter may be set, encoded, or decoded only with respect to atransform unit having depths of 0, 1, and 2 where are depths of 2 orless, in the intra-slice within the sequence. In the presence of a blockhaving a depth deeper than 2, which is a depth of a block in which aquantization parameter is set, it is possible to set a quantizationparameter of the block having the deeper depth so as to be the same asthe quantization parameter set at the depth of 2.

Table 3 shows an example of a sequence parameter set (SPS) including asyntax element representing quantization parameter information based ona size of a block in an inter-slice or an intra-slice.

TABLE 3 C Descriptor seq_parameter_set_rbsp( ) { profile_idc 0 u(8) ...log2_min_coding_unit_size_minus3 0 ue(v)log2_diff_max_min_coding_unit_size 0 ue(v) ...log2_min_transform_size_minus2 0 ue(v) log2_diff_max_min_transform_size0 ue(v) max_transform_hierarchy_depth_inter 0 ue(v)max_transform_hierarchy_depth_intra 0 ue(v) log2_qp_unit_size_inter 0ue(v) log2_qp_unit_size_intra 0 ue(v) ... rbsp_trailing_bits( ) 0 }

In Table 3, log2_qp_unit_size_inter indicates a syntax elementrepresenting a specific size of a block in which a quantizationparameter is set, encoded, or decoded in an inter-slice, andlog2_qp_unit_size_intra indicates a syntax element representing aspecific size of a block in which a quantization parameter is set,encoded, or decoded in an intra-slice. Here, the SPS may include onlyany one syntax element of log2_qp_unit_size_inter andlog2_qp_unit_size_intra.

For example, when log2_qp_unit_size_inter is 3, a quantization parametermay be set, encoded, or decoded only with respect to a block having asize of 8×8 or more, in an inter-slice within a sequence. In thepresence of a block having a size smaller than 8×8, which is a size of ablock in which a quantization parameter is set, it is possible to set aquantization parameter of the block having the smaller size so as to bethe same as the quantization parameter set at the size of 8×8.

For example, when log2_qp_unit_size_intra is 4, a quantization parametermay be set, encoded, or decoded only with respect to a block having asize of 16×16 or more, in an intra-slice within a sequence. In thepresence of a block having a size smaller than 16×16, which is a size ofa block in which a quantization parameter is set, it is possible to seta quantization parameter of the block having the smaller size so as tobe the same as the quantization parameter set at the size of 16×16.

The picture parameter set (PPS) described above in FIGS. 1 to 8 may havea configuration as shown in the following Tables 4 to 5. Hereinafter, aquantization parameter will be used to generally represent a residualquantization parameter as well as a quantization parameter.

Table 4 shows an example of a picture parameter set (PPS) including asyntax element representing a specific depth or a specific size of ablock in which a quantization parameter is set.

TABLE 4 C Descriptor pic_parameter_set_rbsp( ) { pic_parameter_set_id 1ue(v) seq_parameter_set_id 1 ue(v) entropy_coding_mode_flag 1 u(1)num_ref_idx_10_default_active_minus1 1 ue(v)num_ref_idx_11_default_active_minus1 1 ue(v) pic_init_qp_minus26 /*relative to 26 */ 1 se(v) qp_hierarchy_depth 1 ue(v) log2_qp_unit_size 1ue(v) constrained_intra_pred_flag 1 u(l) for(i=0;i<15; i++){numAllowedFilters[i] 1 ue(v) for(j=0;j<numAllowedFilters;j++){filtIdx[i][j] 1 ue(v) } } rbsp_trailing_bits( ) 1 }

In Table 4, qp_hierarchy_depth indicates a syntax element representing aspecific depth of a block in which a quantization parameter is set,encoded, or decoded, and log2_qp_unit_size indicates a syntax elementrepresenting a specific size of a block in which a quantizationparameter is set, encoded, or decoded. Here, the PPS may include onlyany one syntax element of qp_hierarchy_depth and log2_qp_unit_size.

For example, when qp_hierarchy_depth is 1, a quantization parameter maybe set, encoded, or decoded only with respect to a transform unit havingdepths of 0 and 1, which are depths of 1 or less, within a picture. Inthe presence of a block having a depth deeper than 1, which is a depthof a block in which a quantization parameter is set, it is possible toset a quantization parameter of the block having the deeper depth so asto be the same as the quantization parameter set at the depth of 1.

For example, when log2_qp_unit_size is 3, a quantization parameter maybe set, encoded, or decoded only with respect to a block having a sizeof 8×8 or more, within a picture. In the presence of a block having asize smaller than 8×8, which is a size of a block in which aquantization parameter is set, it is possible to set a quantizationparameter of the block having the smaller size so as to be the same asthe quantization parameter set at the size of 8×8.

Table 5 shows an example of a picture parameter set (PPS) including asyntax element associated with quantization parameter changeableinformation.

TABLE 5 C Descriptor pic_parameter_set_rbsp( ) { pic_parameter_set_id 1ue(v) seq_parameter_set_id 1 ue(v) entropy_coding_mode_flag 1 u(1)num_ref_idx_10_default_active_minus1 1 ue(v)num_ref_idx_11_default_active_minus1 1 ue(v) pic_init_qp_minus26 /*relative to 26 */ 1 se(v) qp_change_allowed_flag 1 u(1)constrained_intra_pred_flag 1 u(1) for(i=0;i<15; i++){numAllowedFilters[i] 1 ue(v) for(j=0;j<numAllowedFilters;j++){filtIdx[i][j] 1 ue(v) } } rbsp_trailing_bits( ) 1 }

In Table 5, qp_change_allowed_flag indicates a syntax element associatedwith quantization parameter changeable information. The apparatus fordecoding an image may decode qp_change_allowed_flag in the PPS. When alogical value of qp_change_allowed_flag is 1, the apparatus for decodingan image may decode a quantization parameter in a unit lower than apicture to thereby change the quantization parameter and set thequantization parameter according to the changed value. In addition, whena logical value of qp_change_allowed_flag is 0, the apparatus fordecoding an image may neither decode the quantization parameter in theunit lower than the picture nor change the quantization parameter.

The slice header described above in FIGS. 1 to 8 may have aconfiguration as shown in the following Tables 6 to 7. Hereinafter, aquantization parameter will be used to generally represent a residualquantization parameter as well as a quantization parameter.

Table 6 shows an example of a slice header including a syntax elementrepresenting a specific depth or a specific size of a block in which aquantization parameter is set.

TABLE 6 C Descriptor slice_header( ) { first_lctb_in_slice 2 ue(v)slice_type 2 ue(v) pic_parameter_set_id 2 ue(v) frame_num 2 u(v) ...ref_pic_list_modification( ) ... slice_qp_delta 2 se(v)qp_hierarchy_depth 1 ue(v) log2_qp_unit_size 1 ue(v) ... alf_param( ) if( slice_type = = B && mv_competition_flag) collocated_from_10_flag 2u(1) }

In Table 6, qp_hierarchy_depth indicates a syntax element representing aspecific depth of a block in which a quantization parameter is set,encoded, or decoded, and log2_qp_unit_size indicates a syntax elementrepresenting a specific size of a block in which a quantizationparameter is set, encoded, or decoded. Here, the slice header mayinclude only any one syntax element of qp_hierarchy_depth andlog2_qp_unit_size.

For example, when qp_hierarchy_depth is 3, a quantization parameter maybe set, encoded, or decoded only with respect to a transform unit havingdepths of 0, 1, and 2, which are depths of 3 or less, within a slice. Inthe presence of a block having a depth deeper than 3, which is a depthof a block in which a quantization parameter is set, it is possible toset a quantization parameter of the block having the deeper depth so asto be the same as the quantization parameter set at the depth of 3.

For example, when log2_qp_unit_size is 4, a quantization parameter maybe set, encoded, or decoded only with respect to a block having a sizeof 16×16 or more, within a slice. In the presence of a block having asize smaller than 16×16, which is a size of a block in which aquantization parameter is set, it is possible to set a quantizationparameter of the block having the smaller size so as to be the same asthe quantization parameter set at the size of 16×16.

Table 7 shows an example of a slice header including a syntax elementrepresenting a specific depth or a specific size of a block in which aquantization parameter is set in a specific slice type.

TABLE 7 C Descriptor slice_header( ) { first_lctb_in_slice 2 ue(v)slice_type 2 ue(v) pic_parameter_set_id 2 ue(v) frame_num 2 u(v) ...ref_pic_list_modification( ) ... slice_qp_delta 2 se(v) if( slice_type == P || slice_type = = B ) { qp_hierarchy_depth 1 ue(v) log2_qp_unit_size1 ue(v) } ... alf_param( ) if ( slice_type = = B && mv_competition_flag)collocated_from_10_flag 2 u(1) }

In Table 7, qp_hierarchy_depth indicates a syntax element representing aspecific depth of a block in which a quantization parameter is set,encoded, or decoded only in a specific slice type, and log2_qp_unit_sizeindicates a syntax element representing a specific size of a block inwhich a quantization parameter is set, encoded, or decoded only in aspecific slice type. Here, the slice header may include only any onesyntax element of qp_hierarchy_depth and log2_qp_unit_size.

For example, when qp_hierarchy_depth is 3, a quantization parameter maybe set, encoded, or decoded only with respect to a transform unit havingdepths of 0, 1, and 2, which are depths of 3 or less, within a P slice.In the presence of a block having a depth deeper than 3, which is adepth of a block in which a quantization parameter is set, it ispossible to set a quantization parameter of the block having the deeperdepth so as to be the same as the quantization parameter set at thedepth of 3.

For example, when log2_qp_unit_size is 4, a quantization parameter maybe set, encoded, or decoded only with respect to a block having a sizeof 16×16 or more, within a B slice. In the presence of a block having asize smaller than 16×16, which is a size of a block in which aquantization parameter is set, it is possible to set a quantizationparameter of the block having the smaller size so as to be the same asthe quantization parameter set at the size of 16×16.

Table 8 shows an example of an encoding block in which a quantizationparameter is set, encoded, or decoded according to a syntax elementrepresenting a size of the block in which the quantization parameter isset, encoded, or decoded.

TABLE 8 C Descriptor coding_unit( x0, y0, currCodingUnitSize ) {2if(log2CUSize>log2_qp_unit_size) 2 coding_unit_qp_delta 2 se(v) if(x0 +( 1 << log2CUSize ) = PicWidthInSamplesL &&y0 + 2 ( 1 << log2CUSize ) =PicHeightInSamplesL &&log2CUSize > Log2MinCUSize )split_coding_unit_flag 2 u(1) | ae(v)

In Table 8, log2_qp_unit_size indicates a syntax element representing aspecific size of a block in which a quantization parameter is set,encoded, or decoded, coding_unit_qp_delta indicates a residualquantization parameter in a coding unit, and log2CUSize indicates a sizeof an encoding or decoding object coding unit. Here, the coding unit mayinclude a residual quantization parameter only up to at a specific sizeof a block according to a size thereof. In addition, in the presence ofa block having a size smaller than a specific size of a block in which aquantization parameter is set, it is possible to set a quantizationparameter of the block having the smaller size so as to be the same asthe quantization parameter set at the specific size, thereby omitting aprocess of encoding and decoding the quantization parameter of the blockhaving the smaller size. In addition, the apparatus for encoding animage may set and transmit quantization parameters for each of allcoding units having a size of a specific block size or more.

For example, when log2CUSize is 4 and log2_qp_unit_size is 3, anencoding and decoding object encoding block has a size of 16×16, and acoding unit in which a quantization parameter is set, encoded, ordecoded has a size of 8×8. Therefore, coding_unit_qp_delta, which is aresidual quantization parameter of a coding unit, may be set, encoded,or decoded in a corresponding coding unit.

Table 9 shows an example of an encoding block including a syntax elementrepresenting a depth of a block in which a quantization parameter isset, encoded, or decoded.

TABLE 9 C Descriptor transform_tree( x0, y0, log2TrafoSize, trafoDepth,blkIdx ) { if(trafoDepth = = 0 && intra_split_flag = = 0){ if(!entropy_coding_mode_flag ) { cbp_yuv_root vlc(n,v) ...residualDataPresentFlag = (cbp_yuv_root != 0) } else { if(PredMode != MODE_INTRA ) no_residual_data_flag 3 | 4 u(1) | ae(v)residualDataPresentFlag = !no_residual_data_flagb } } else { ...residualDataPresentFlag = true } if( residualDataPresentFlag) {if(trafoDepth < qp_hierarchy_depth) transform_unit_qp_delta 3 | 4 se(v)...

In Table 9, qp_hierarchy_depth indicates a specific depth of a block inwhich a quantization parameter is set, transform_unit_qp_delta indicatesa residual quantization parameter in a transform unit, trafoDepthindicates a depth of an encoding and decoding object transform unit, andresidualDataPresentFlag indicates whether or not a residual signal to beencoded and decoded is present. Here, the apparatus for encoding anddecoding an image may include residual quantization parameters of anencoding object block and a decoding object block only up to at aspecific depth of the block according to a depth of the transform unit.

In addition, in the presence of a block having a depth deeper than aspecific depth of a block in which a quantization parameter is decoded,it is possible to set a quantization parameter of the block having thedepth deeper than the specific depth so as to be the same as thequantization parameter set at the specific depth, thereby omitting aprocess of encoding and decoding the quantization parameter of the blockhaving the deeper depth.

Further, only in the presence of a residual signal to be encoded and atransform unit has a depth shallower than qp_hierarchy_depth, theapparatus for encoding an image may set and transmit the quantizationparameter in the transform unit, and the apparatus for decoding an imagemay receive and set the quantization parameter in the transform unit.

For example, when residualDataPresentFlag is 1, trafoDepth is 2, andqp_hierarchy_depth is 3, a residual signal is present in an encoding anddecoding object transform unit, the encoding and decoding objecttransform unit has a depth of 2, and a block in which a quantizationparameter is set, encoded, or decoded has a depth of 3. Therefore,transform_unit_qp_delta, which is a residual quantization parameter in atransform unit, may be set, encoded, or decoded in the transform unit

Table 10 shows an example of a transform unit in the case in which thetransform unit in which a quantization parameter is set has a specificdepth fixed to 1. That is, Table 10 shows an example of a transform unitdoes not include a syntax element representing a depth of a block inwhich a quantization parameter is set, encoded, or decoded.

TABLE 10 C Descriptor transform_tree( x0, y0, log2TrafoSize, trafoDepth,blkIdx ) { if(trafoDepth = = 0 && intra_split_flag = = 0){ if(!entropy_coding_mode_flag ) { cbp_yuv_root vlc(n,v) ...residualDataPresentFlag = (cbp_yuv_root != 0) } else { if(PredMode != MODE_INTRA ) no_residual_data_flag 3 | 4 u(1) | ae(v)residualDataPresentFlag = !no_residual_data_flagb } } else { ...residualDataPresentFlag = true } if( residualDataPresentFlag) {if(trafoDepth < 1) transform_unit_qp_delta 3 | 4 se(v) ...

In Table 10, trafoDepth indicates a depth of an encoding and decodingobject transform unit, and residualDataPresentFlag indicates whether ornot a residual signal is present in the encoding and decoding objecttransform unit. Here, when trafoDepth is 0, the apparatus for encodingan image may perform transform at the same size as that of the codingunit. In addition, only in the presence of a residual signal,transform_unit_qp_delta may be transmitted. Here, since trafoDepth issmaller than 1, a quantization parameter may be set only at theshallowest depth in the encoding and decoding object transform unit, andtransform_unit_qp_delta may be encoded and decoded. That is, thequantization parameter may be set in a transform unit having the samesize as that of the coding unit, and transform_unit_qp_delta may beencoded and decoded. Further, in the case of a transform unit having adepth that is the same as 1 or is deeper than 1, a quantizationparameter that is the same as the quantization parameter set at theshallowest depth is set, thereby omitting encoding and decoding thereof.That is, only in the presence of a residual signal to be encoded in atransform unit having the same size as that of the coding unit, aquantization parameter is set, and a residual quantization parameter isencoded and decoded.

Table 11 shows an example of a transform unit including a syntax elementrepresenting a size and a depth of a block in which a quantizationparameter is set.

TABLE 11 C Descriptor transform_tree( x0, y0, log2TrafoSize, trafoDepth,blkIdx ) { ... if(log2CUSize > log2_qp_unit_size &&trafoDepth = = 0 &&residualDataPresentFlag) { unit_qp_delta 3 | 4 se(v) ...

In Table 11, log2_qp_unit_size indicates a specific size of a unit inwhich a quantization parameter is set, encoded, or decoded,unit_qp_delta indicates a residual quantization parameter of a transformunit, trafoDepth indicates a depth of an encoding or decoding objecttransform unit, and residualDataPresentFlag indicates whether or not aresidual signal to be encoded or decoded is present. Here, the transformunit may include a residual quantization parameter only up to at aspecific size of a block according to a size of the coding unit. Inaddition, in the presence of a block having a size smaller than aspecific size of a block in which a quantization parameter is set, it ispossible to set a quantization parameter of the block having the smallersize so as to be the same as the quantization parameter set at thespecific size, thereby omitting a process of encoding and decoding theresidual quantization parameter of the block having the smaller size. Inaddition, the apparatus for encoding and decoding an image may set,encode, and decode quantization parameters for all coding units having asize of a specific block size or more. In addition, since the transformunit has a depth of 0, the apparatus for encoding and decoding an imagemay perform transform and inverse transform at the same size as that ofthe coding unit.

For example, when log2CUSize is 3, log2_qp_unit_size is 2, trafoDepth is0, and residualDataPresentFlag is 1, an encoding or decoding objectcoding unit has a size of 8×8, a coding unit in which a quantizationparameter is set, encoded, or decoded has a size of 4×4, a transformunit has a depth of 0, and a residual signal is present. Therefore,unit_qp_delta, which is a residual quantization parameter in a transformunit, may be set, encoded, or decoded in a corresponding coding unit.

Table 12 shows an example of a picture parameter set (PPS) including asyntax element associated with quantization parameter changeableinformation.

TABLE 12 C Descriptor pic_parameter_set_rbsp( ) { pic_parameter_set_id 1ue(v) seq_parameter_set_id 1 ue(v) entropy_coding_mode_flag 1 u(1)num_ref_idx_10_default_active_minus1 1 ue(v)num_ref_idx_11_default_active_minus1 1 ue(v) pic_init_qp_minus26 /*relative to 26 */ 1 se(v) minCUDQPsize 1 f(4)constrained_intra_pred_flag 1 u(1) for(i=0;i<15; i++){numAllowedFilters[i] 1 ue(v) for(j=0;j<numAllowedFilters;j++){filtIdx[i][j] 1 ue(v) } } rbsp_trailing_bits( ) 1 }

In Table 12, minCUDQPsize indicates a syntax element representing aspecific size of a block in which a quantization parameter is set,encoded, or decoded.

For example, when minCUDQPsize is 0, a quantization parameter may beset, encoded, or decoded only with respect to a block having the samesize as that of a LCU, within a picture. When minCUDQPsize is 1, aquantization parameter may be set, encoded, or decoded with respect to ablock having the same size as or larger size than that of a block havinga width and a height that are half of those of the LCU. That is, whenthe LCU is 64×64 and minCUDQPsize is 1, a quantization parameter may beset, encoded, or decoded only with respect to a block having the samesize as or larger size than 32×32. That is, when minCUDQPsize is N, aquantization parameter may be set, encoded, or decoded only with respectto a block having the same size as or larger size than that of a blockhaving a width and a height that are half of those in the case in whichminCUDQPsize is N-1. Where N indicates a positive integer. In thepresence of a block having a size smaller than a specific size of theblock in which the quantization parameter is set, it is possible to seta quantization parameter of the block having the smaller size so as tobe the same as the quantization parameter set at the specific size.

In addition, minCUDQPsize may be encoded to have M bits of fixed lengthor a variable length. Where M indicates a positive integer. The aboveTable 12 shows an example in which M is 4.

In addition, minCUDQPsize is not transmitted in the PPS or the sliceheader and a fixed block size is predefined in an encoder or a decoder,such that a quantization parameter may be set, encoded, or decoded onlywith respect to a block having the same size as or larger size than thatof the fixed block size. Where N indicates a positive integer.

Table 13 shows an example of a slice header including a syntax elementassociated with quantization parameter changeable information.

TABLE 13 C Descriptor slice_header( ) { first_lctb_in_slice 2 ue(v)slice_type 2 ue(v) pic_parameter_set_id 2 ue(v) frame_num 2 u(v) ...ref_pic_list_modification( ) ... slice_qp_delta 2 se(v) minCUDQPsize 1f(4) ... alf_param( ) if ( slice type = = B && mv_competition_flag)collocated_from_10_flag 2 u(1) }

In Table 13, minCUDQPsize indicates a syntax element representing aspecific size of a block in which a quantization parameter is set,encoded, or decoded.

For example, when minCUDQPsize is 0, a quantization parameter may beset, encoded, or decoded only with respect to a block having the samesize as that of a LCU, within a slice. When minCUDQPsize is 1, aquantization parameter may be set, encoded, or decoded with respect to ablock having the same size as or larger size than that of a block havinga width and a height that are half of those of the LCU. That is, whenthe LCU is 64×64 and minCUDQPsize is 1, a quantization parameter may beset, encoded, or decoded only with respect to a block having the samesize as or larger size than 32×32. That is, when minCUDQPsize is N, aquantization parameter may be set, encoded, or decoded only with respectto a block having the same size as or larger size than that of a blockhaving a width and a height that are half of those in the case in whichminCUDQPsize is N-1. Where N indicates a positive integer. In thepresence of a block having a size smaller than a specific size of theblock in which the quantization parameter is set, it is possible to seta quantization parameter of the block having the smaller size so as tobe the same as the quantization parameter set at the specific size.

In addition, minCUDQPsize may be encoded to have M bits of fixed lengthor a variable length. Where M indicates a positive integer.

Table 14 shows an example of a LCU syntax (a coding tree syntax)including a syntax element associated with quantization parameterchangeable information.

TABLE 14 Descriptor coding_tree( x0, y0, log2CUSize ) { if( x0 + ( 1 <<log2CUSize ) <= PicWidthInSamplesL &&y0 + ( 1 << log2CUSize) <= PicHeightInSamplesL &&log2CUSize > Log2MinCUSize )split_coding_unit_flag[ x0 ][ y0 ] u(1) | ae(v) if (Log2MaxCUSize ==log2CUSize && split_coding_unit_flag[ x0 ][ y0 ]) lcu_qp_level ue(v) if(adaptive_loop_filter_flag && alf_cu_control_flag ) { cuDepth =Log2MaxCUSize log2CUSize if( cuDepth <= alf_cu_control_max_depth ) if(cuDepth == alf_cu_control_max_depth || split_coding_unit_flag[ x0 ][ y0] == 0 ) AlfCuFlagIdx++ } if( split_coding_unit_flag[ x0 ][ y0 ] ) { x1= x0 + ( ( 1 << log2CUSize ) >> 1 ) y1 = y0 + ( ( 1 << log2CUSize ) >> 1) coding_tree( x0, y0, log2CUSize 1 ) if( x1 < PicWidthInSamplesL )coding_tree( x1, y0, log2CUSize − 1 ) if( y1 < PicHeightInSamplesL ){coding_tree( x0, y1, log2CUSize − 1 ) if( x1 < PicWidthInSamplesL && y1< PicHeightInSamplesL ) coding_tree( x1, y1, log2CUSize − 1 ) } else {if(adaptive_loop_filter_flag && alf_cu_control_flag ) AlfCuFlag[ x0 ][y0 ] = alf_cu_flag[ AlfCuFlagIdx ] coding_unit( x0, y0, log2CUSize ) } }

In Table 14, lcu_qp_level indicates a syntax element representing aspecific size of a block in which a quantization parameter is set,encoded, or decoded. The specific size of the block in which thequantization parameter is set, encoded, or decoded may be calculated asfollows.QP_block_size=LCU_size»lcu_qp_level

Where QP_block_size indicates a specific size of a block in which aquantization parameter is set, encoded, or decoded, and LCU_sizeindicates a size of a LCU.

In addition, lcu_qp_level is transmitted only when a corresponding LCUor block is divided, and a quantization parameter may be set, encoded,or decoded according to QP_block_size. For example, in Table 14, it maybe appreciated that when split_coding_unit_flag[x0][y0] is 1, acorresponding block was divided and when split_coding_unit_flag[x0][y0]is 0, a corresponding block was not divided. In addition, only whensplit_coding_unit_flag[x0][y0] is 1 and a corresponding block has thesame size as that of the LCU, a quantization parameter may be set,encoded, or decoded with respect to a block having the same size orlarger size than QP_block_size.

In addition, lcu_qp_level is transmitted only when a residual signal ispresent in a corresponding LCU or block, and a quantization parametermay be set, encoded, or decoded according to the calculatedQP_block_size.

For example, when lcu_qp_depth is 0, a quantization parameter may beset, encoded, or decoded only with respect to a block having the samesize as that of the LCU. When lcu_qp_depth is 1, a quantizationparameter may be set, encoded, or decoded with respect to a block havingthe same size as or larger size than that of a block having a width anda height that are half of those of the LCU. That is, when the LCU is64×64 and lcu_qp_depth is 1, a quantization parameter may be set,encoded, or decoded only with respect to a block having the same size asor larger size than 32×32. That is, when lcu_qp_depth is N, aquantization parameter may be set, encoded, or decoded only with respectto a block having the same size as or larger size than that of a blockhaving a width and a height that are half of those in the case in whichlcu_qp_depth is N-1. Where N indicates a positive integer.

In addition, lcu_qp_depth may be encoded to have M bits of fixed lengthor a variable length. Where M indicates a positive integer.

Table 15 shows an example of a picture parameter set (PPS) including asyntax element associated with quantization parameter changeableinformation in which qp_change_allowed_flag of Table 5 and minCUDQPsizeof Table 12 are integrated with each other.

TABLE 15 C Descriptor pic_parameter_set_rbsp( ) { pic_parameter_set_id 1ue(v) seq_parameter_set_id 1 ue(v) entropy_coding_mode_flag 1 u(1)num_ref_idx_10_default_active_minus1 1 ue(v)num_ref_idx_11_default_active_minus1 1 ue(v) pic_init_qp_minus26 /*relative to 26 */ 1 se(v) cu_dqp_idc 1 ue(v) constrained_intra_pred_flag1 u(1) for(i=0;i<15; i++){ numAllowedFilters[i] 1 ue(v)for(j=0;j<numAllowedFilters;j++){ filtIdx[i][j] 1 ue(v) } }rbsp_trailing_bits( ) 1 }

In Table 15, cu_dqp_idc indicates a syntax element associated withquantization parameter changeable information. The apparatus fordecoding an image may decode cu_dqp_idc in the PPS. When a value ofcu_dqp_idc is 0, the apparatus for decoding an image may neither decodea quantization parameter in a unit lower than a picture nor change thequantization parameter in the unit lower than the picture. When a valueof cu_dqp_idc is a positive number of larger than 0, the apparatus fordecoding an image may change the quantization parameter in the unitlower than the picture, and the value of cu_dqp_idc may indicate aspecific size of a block in which the quantization parameter is set,encoded, or decoded.

For example, when cu_dqp_idc is 1, a quantization parameter may be set,encoded, or decoded only with respect to a block having the same size asthat of a LCU, within a picture. When cu_dqp_idc is 2, a quantizationparameter may be set, encoded, or decoded with respect to a block havingthe same size as or larger size than that of a block having a width anda height that are half of those of the LCU. For example, when the LCU is64×64 and cu_dqp_idc e is 2, a quantization parameter may be set,encoded, or decoded only with respect to a block having the same size asor larger size than 32×32. In the presence of a block having a sizesmaller than a specific size of the block in which the quantizationparameter is set, it is possible to set a quantization parameter of theblock having the smaller size so as to be the same as the quantizationparameter set at the specific size.

Meanwhile, an order of each operation described in FIGS. 1, 2, 5 and 6may be changed.

Although the exemplary embodiments of the present invention have beendisclosed for illustrative purposes, those skilled in the art willappreciate that various modifications, additions and substitutions arepossible, without departing from the scope and spirit of the inventionas disclosed in the accompanying claims.

Accordingly, the scope of the present invention is not construed asbeing limited to the described embodiments but is defined by theappended claims as well as equivalents thereto.

The invention claimed is:
 1. A method for decoding an image, the methodcomprising: decoding base block size information on a size of a baseblock from a bitstream; decoding residual presence information of adecoding object unit from the bitstream, the residual presenceinformation indicating whether the decoding object unit has residualsignal or not; when the residual presence information indicates that thedecoding object unit has the residual signal, decoding a residualquantization parameter of the decoding object unit from the bitstream;determining a quantization parameter of the decoding object unit basedon the residual quantization parameter of the decoding object unit; andperforming inverse quantization for the decoding object unit based onthe quantization parameter, wherein the residual quantization parameteris included in a transform unit TU, and wherein when a size of thedecoding object unit is smaller than a size of the base block specifiedby the base block size information, the quantization parameter of thedecoding object unit is same as quantization parameters of all the otherdecoding units included in the base block together with the decodingobject unit.
 2. The method of claim 1, wherein the residual quantizationparameter is selectively decoded based on quantization parameter flaginformation, the quantization parameter flag information specifyingwhether the residual quantization parameter is present in the bitstream.3. The method of claim 1, wherein the residual quantization parameter isdecoded when the decoding object unit has a first order among aplurality of units included in the base block.
 4. A method for encodingan image, the method comprising: determining a size of a base block andencoding base block size information on the size of the base block intoa bitstream; determining whether an encoding object unit has residualsignal or not and encoding residual presence information of the encodingobject unit into the bitstream, the residual presence informationindicating whether the encoding object unit has residual signal or not;determining a quantization parameter of the encoding object unit;performing quantization for the encoding object unit based on thequantization parameter; and when the residual presence informationindicates that the encoding object unit has the residual signal,determining a residual quantization parameter of the encoding objectunit based on the quantization parameter and encoding the residualquantization parameter into the bitstream, wherein the residualquantization parameter is included in a transform unit TU, and whereinwhen a size of the encoding object unit is smaller than a size of thebase block specified by the base block size information, thequantization parameter of the encoding object unit is same asquantization parameters of all the other encoding units included in thebase block together with the encoding object unit.
 5. The method ofclaim 4, wherein the residual quantization parameter is selectivelyencoded based on quantization parameter flag information, thequantization parameter flag information specifying whether the residualquantization parameter is present in the bitstream.
 6. The method ofclaim 4, wherein the residual quantization parameter is encoded when theencoding object unit has a first order among a plurality of unitsincluded in the base block.
 7. A non-transitory computer-readable mediumstoring a bitstream, wherein the bitstream is generated by a method forencoding an image, the method comprising: determining a size of a baseblock and encoding base block size information on the size of the baseblock into a bitstream; determining whether an encoding object unit hasresidual signal or not and encoding residual presence information of theencoding object unit into the bitstream, the residual presenceinformation indicating whether the encoding object unit has residualsignal or not; determining a quantization parameter of the encodingobject unit; performing quantization for the encoding object unit basedon the quantization parameter; and when the residual presenceinformation indicates that the encoding object unit has the residualsignal, determining a residual quantization parameter of the encodingobject unit based on the quantization parameter and encoding theresidual quantization parameter into the bitstream, wherein the residualquantization parameter is included in a transform unit TU, and whereinwhen a size of the encoding object unit is smaller than a size of thebase block specified by the base block size information, thequantization parameter of the encoding object unit is same asquantization parameters of all the other encoding units included in thebase block together with the encoding object unit.